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? [import]uid: 10818 topic_id: 15587 reply_id: 315587[/import]

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. [import]uid: 70114 topic_id: 15587 reply_id: 57554[/import]

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? :wink:

Again, I appreciate the link!
[import]uid: 10818 topic_id: 15587 reply_id: 57565[/import]

Tho I wonder if they will come out with support for Amiga HAM6 files soon? :wink:

Shall add this to the feature request pile?

Peach :wink: [import]uid: 52491 topic_id: 15587 reply_id: 57583[/import]

There are PNG processors that will strip out extra info in a PNG. I’ve found with large images this can save a good 50K. Also ensure you save you PNG without transparency ( if it doesn’t need it ) as that also takes the file sizes down a little.

Without an Amiga chipset you can’t actually display a HAM6 images, its more than just a file format. Saying that however, its also outdated so I would say HAM8. [import]uid: 5354 topic_id: 15587 reply_id: 57595[/import]

aha that explains it. I’d rather there was an error message in the simulator saying gifs arent supported on android [import]uid: 74338 topic_id: 15587 reply_id: 92270[/import]