- Online Community Forums » Programming Questions » Png fails to load on iOS

This thread is locked; no one can reply to it. rss feed Print
Png fails to load on iOS
Space cpp
Member #16,322
May 2016

I recently compiled libpng using the following xcode project:

Attempting to load a .png file always returns NULL, tried more than one file. Bmp loads fine through.
Also tested in both simulator and real device, no difference.

Ps: at first trying to build the app gave me an error:

Undefined symbols for architecture armv7:
"_png_init_filter_functions_neon", referenced from:

After a short google search I recompiled the library with this feature turned off. Could it be the reason?

Edgar Reynaldo
Member #8,592
May 2007

Uh, yeah. That's why. You need the image addon initialized and with png support built in during compilation. <o.o>

Space cpp
Member #16,322
May 2016

Found the solution.

In xcode project settings -> build settings there is "compress png files" and "remove text metadata from png files" both must be set to NO.

Go to: