Problem to display png image under palm os

Hi,

I've write a J2ME code that can get from a stream a picture everything work on the motorola and other phone device but the same code doe'sn't run under POSE

when i try to create the image:

Image.createImage(byteArray, 0, byteArray.length);

I receive an IllegalArgument Exception.

The same code run perfect under all other emulation.

Something can help me

thanks

Richard

Richard@goldmail.net.il

[476 byte] By [richiegr] at [2007-9-26 14:20:29]
# 1

[richiegr],

Is the image file in the PNG format?

See the documentation for the MIDP 1.0 API specification under the Image.createImage(byte[] imageData, int imageOffset, int imageLength) for the description of the requirements for the PNG image file format.

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Hi,

Yes I am absolutly sure about the format cause I've made myself the translation from GIF to Png.

I receive the data from StreamConnection i store the byte in a byte array then i try to create the image. Now the same image saved as his and loaded directly by contentConnection work.

The problem occurs ONLY on POSE not on other emulator

Thanks

Richard

richiegr at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Hi,I have the same problem on my Palm. I can display images on the Siemens SL45i, but not on Palm devices.Marco
mopfattn at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
If anyone has solved this PNG problem under the palm, please inform me.
johnlw at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

Hi everyone who had responded to this thread,

I suddenly recalled that there is a constraint of the file size for the PNG image file when one uses the MIDP for Palm OS 1.0 BETA on a Palm device. It was a limitation imposed by the implementation.

The maximum file size for a PNG image file for use with MIDP for Palm OS 1.0 is 64kbytes i.e. any image file that is larger than 64kb will not display.

Try experimenting with smaller image file sizes and let me know if this is still true.

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
I can display a PNG image of 5kb perfect in all devices except the palm.Thus ur assumption is incorrect.
johnlw at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7

I can display a PNG image of 5kb perfect in all devices except the palm. I download this image via a HTTP connection.

Ive seen an example called HappyFace where a PNG image is loaded from a jar file, which works perfect. But when trying to do the same via a HTTP connection this fails.

Thus ur assumption is incorrect.

johnlw at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8

Hi everyone.

My assumtions was too hasty. I found that when I convert my PNG image to grayscale and reduce the number of colors to 16 it works perfectly on the Palm.

Thus you can now download a 16 color grayscale PNG image via a http connection and display it in the Palm.

Cheers folks

John

johnlw at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 9
Hi,Definitly the number of color in the picture is the problem, the motorola emulator have no problem to display any image but the palm is limited to 16 colors.ThanksRichard
richiegr at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 10

To all who responded to this thread,

Can I assume that the limitation with the 16 colors for the PNG image files to work with Palm OS devices is only true for the monochrome Palm displays?

I am trying to document this finding into our database here.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 11
This limitation seems to exist also for Palms with color displays, like the Palm m505.
mopfattn at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 12
Is there any difference between the size of an image and the size of the object representing that image?From the way I understand the KVM on the Palm works, no Object can be bigger than 64K.Is it possible that an Object representing a 5K image could be more than 64K?
lnoelstorr at 2007-7-2 15:58:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...