GIF images don't work on android device builds - Bug?

I've got a Samsung Galaxy SII. When I compile and install a very simple corona (3 lines of code, below) everything works in the simulator. It works on the iPhone, too. But on my Android phone, when I try to launch it, it says: "Error This application has been corrupted". Here's the code:

mapImg = display.newImage("map.gif")
mapImg:setReferencePoint(display.TopLeftReferencePoint)
mapImg.x, mapImg.y = 0,0

Now, I changed the image from a .gif to a .png, and everything works fine again.

Curious, I searched everywhere in the docs and don't see anything that says GIF images aren't supported on Android. And since it works fine on iOS, why would I assume it is different on Android? So I then tried saving my "map" image out as a GIF again. Maybe it must be a full color 256 gif, not just 32 or 16 colors? Maybe "convert to sRGB" should not be checked when exporting. maybe it should. I tried a lot of combinations. Still no luck.

So, question #1: Are GIF files not supported on Android? And if so, then question #2: Why isn't this in the documentation?

Or is this a bug of some kind?

http://developer.anscamobile.com/content/display-objects#Loading_an_Image

AFAIR everywhere is described: PNG and JPEG is supported. No need to write: GIF, TIFF, PIFF, TGA, PCX, PSD, PDS, RNB, NPD, XXL, ... isn't supported.

Convert your GIFs to PNGs as you've done.
Don't use indexed or grayscale PNGs.

And you will be happy on iOS and Android.

Go further and try to see the advantages of PNG over GIF. Forget about color reduced Images below 24 bit. This are special cases mostly unwanted these days and are not supported by Corona SDK.

Sven-

Yes, PNGs are better. I've got one of those exceptions where every little bit of memory helps, so I opted to save 300k with 3 GIFs.

Thanks for the link. Good to know for sure. That said, the doc you pointed to is more a part of the "how to" documentation. I looked thru the actual API reference docs for "dislay.newImage()" and "display.newImageRect()" and it doesn't make a single mention about JPGs and nothing about PNGs save the fact that PNGs shouldn't be indexed or use ICC profiles. It may be mentioned in a lot of places, but not in the reference docs, which is the #1 place it this kind of info should be, IMO.

And uh, yeah... kind of obvious Ansca doesn't need to say TIFF, TGA, PCX, PSD, etc aren't supported, don't ya think?... Tho I wonder if they will come out with support for Amiga HAM6 files soon? ;-)

Again, I appreciate the link!

views:1700 update:2011/10/15 21:01:16
corona forums © 2003-2011