Sigh.. here we go... again [crash when loading image]

Hi All,

I’m getting a bit tired of debugging stuff in the Corona “runtime” that crashes the application. This issue also occurs with the latest stable build which used to have no issues with it. If so desired I can send my code over (it’s like 300 lines in total over 2 files) but if it works in the sim, it should work in the build, agreed? Or at the very least, not crash and burn.

For good measure: I have an LG Optimus 2X (note the 2X), dual core and Tegra powered.

I’m getting instant crashes upon loading a PNG somewhere in the code, when I pull the line apart to a bit higher in the code (and commenting out most interactive stuff) it doesn’t crash but doesn’t load the image either.

local test = display.newImage("bug.png")

Is the culprit it seems. The image was exported with the settings in the following screenshot: http://img402.imageshack.us/img402/3631/screenshotps.jpg

Hopefully someone can shed some light on this. It’s not the first time I’m having a bunch of trouble nobody else has so I’m getting the faint feeling Corona just cant cope with either Tegra or Dual Core uC’s. No idea which is involved but my LG is the constant factor.

I’ll gladly do whatever you need me to do to get this fixed as long as it doesn’t involve publicly posting the code or endless testing and exporting (like tonight) on my end.

  • Reinier [import]uid: 53290 topic_id: 12608 reply_id: 312608[/import]

I’ve had a similar issue with a “bad” png file, where it worked fine in the simulator but did bad things on devices. The culprit was a psd file saved with a png extension.

Have you tested your code with a different png file, one you know works such as from an Ansca provided Corona example? If it turns out to be a problem with the png file itself then at least you can figure out another way to export you image file.

I don’t know what program you use to export that image but from your screenshot it seems to be set to export a png24 even though the image has transparent areas. Have you tried exporting it as png32, which supports transparency? [import]uid: 9422 topic_id: 12608 reply_id: 46141[/import]

png’s have to be 32 bit png’s.

no grayscales - and lastly, the filename must match (“img.png”) is no the same as “Img.PNG” on the device.

c [import]uid: 24 topic_id: 12608 reply_id: 46145[/import]

Hi, Thanks for the replies.

Filenames match, so thats not it. Second, I have always exported my images with the same settings and never had any problems. It’s a screenshot of the export for web function in photoshop.

But enfin, let’s go with the fact that the fileformat is wrong then. How would I export a 32-bit PNG from Photoshop? I’ve Googled a bit but nothing conclusive. Again, always exported with these settings and never had any issues.

Ill try using another image tonight. One of my flaws in debugging things is that I tend to dive deep instead of broad… I mean… “the problem can’t possibly lie in the image I never had problems with before!”.

  • Reinier

[import]uid: 53290 topic_id: 12608 reply_id: 46184[/import]

Carlos,
sorry, I interfere.

OK, even if I try to load not 32 bit png, *WHY* Corona crashes? It’s intolerable behavior. It should throws a message about inappropriate image format (and returns nil by display.newImage), but not crashed.
We could get over missing features, but crashes is very annoying things.
Thanks. [import]uid: 9058 topic_id: 12608 reply_id: 46200[/import]

To save a png from Photoshop I use “save as…” and select the png option rather than “save for web and devices”, although your settings for the latter appear to be correct. I don’t doubt its worked in the past. [import]uid: 9422 topic_id: 12608 reply_id: 46213[/import]

whats jpgs are supported? we are seeing blank screen on iOS device when it works correctly in the simulator. we are using jpgs in this instance? Do we also need to be wary of the format of jpg used? [import]uid: 55009 topic_id: 12608 reply_id: 46914[/import]