Problem with iPhone device and PNGImageFormat


#1

Hi there!

When I am running my application on my iTouch device on debug (or release) mode I need to load some .png.

But Juce throws me this :

for this line :

According to the callstack the file has been loaded but its structure has not been recognized :

in png_read_info

else png_handle_unknown(png_ptr, info_ptr, length);

in png_handle_unknown

#endif png_chunk_error(png_ptr, "unknown critical chunk"); }

and finally in png_chunk_error :

if (png_ptr != NULL && png_ptr->error_fn != NULL) (*(png_ptr->error_fn))(png_ptr, '\0');

I really don’t understand, I currently test my app on iPhone Simulator and it works perfectly.

Any ideas?

Thanks.


#2

Are you including this png in your resources? You have to be careful because XCode “helpfully” tries to convert pngs to some kind of optimised format that doesn’t work properly. I think there’s a flag somewhere to force it to use the file without changing it.


#3

Course, there are add in resources, because the file is opened. I will have a look on XCode’s settings. Thanks.


#4

Indeed, in Packaging Settings “Compress PNG file” and “Convert Copied Files” are both disabled.