Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

how to examine cod file- size problem on image change.

Is there anyway to look at the contents of a cod file ( what utilities are there)?

 

I need a <65k app and was doing fine until I swapped out an image.

I'm invoking rapc from the comman line and compiling everything just fine and including an image, Phlash.png. I have several

choices,

$ convert grassyknoll.gif -resize 320x240\! Phlash.png

Administrator@TESTBED01 /cygdrive/e/new/temp/phluant/src/makelaunch
$ ls -al Phla*
-rw-r--r-- 1 Administrator None  5452 Sep 24 12:33 Phlash.jpg
-rw-r--r-- 1 Administrator None 32811 Sep 24 13:30 Phlash.png
-rw-r--r-- 1 Administrator None 30194 Sep 24 09:53 Phlash_real.png

 

If I copy the "_real" image into Phlash.png, everything is fine.  If I use the slightly larger

image OR copy the 5j jpg into Phlash.png, the cod file size explodes by 20-30k.

 

Phlash_real is slighly more white space than the other one so it may compress better but the

5k jpg file is a mystery unless someone tried to transcode it.

 

 

 

 

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: how to examine cod file- size problem on image change.

The rapc compiler converts images into PNG format when an application is built.  The change in size you are seeing could be from the conversion of the image format.  You can disable this by right clicking on your image in the BlackBerry JDE, selecting properties and checking off the do not convert image check box.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: how to examine cod file- size problem on image change.

I'm doing this from the command line and just including the file name on the command line. I would have guessed

some other app would transcode and, anyway, it seems the original file is in the jar. Do you know how I can disable

from the command line ? I'm not sure I have a project handy that I can exmaine in the IDE to see what it does with this option.

 

 

In any case, there is no evidence of transcoding in the far file as the original image seems to be there.

 

Is there a utility to actually see what is in the cod file?

 

Thanks.

 

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: how to examine cod file- size problem on image change.

There -noconvertpng switch tells rapc not to convert images to PNG format.

 

There is no utility to examine the contents of a cod file.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: how to examine cod file- size problem on image change.

Thanks I'll give that a try but I was able to work around using imagemagic and make a smaller image and add a border

that apparently compresses well,

 

533  convert grassyknoll.gif -resize 160x120 -frame 80x60\! Phlashf.png
534  identify Phlashf.png

Phlashf.png PNG 280x240+0+0 DirectClass 10kb 0.010u 0:01

 

Is the cod file format outlined anywhere?

 

I was able to "find" something about convertpng in your compiler class, fwiw,

 

$ strings Compiler.class | grep -B 5 -A 5 conv
        workspace
codename
midlet
class
MIDletMain
convertpng
noshortName
eviscerate
noeviscerate
noparsecod
noverifyerr

 

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: how to examine cod file- size problem on image change.

The cod file format is not publicly documented.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.