[iOS] PNG fatal error: CgBI: unhandled critical chunk

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

[iOS] PNG fatal error: CgBI: unhandled critical chunk

Post by IrrlichtForiOS »

While we're using the Irrlicht 1.9.x development branch to access the iOS Implementation, we are not abled to load png files at the moment.

Every time we try to load a png file as texture we're getting

Code: Select all

PNG fatal error: CgBI: unhandled critical chunk
PNG fatal error: CgBI: unhandled critical chunk
Could not load texture: ecke1.png
Does somebody know the solution to this issue?
CuteAlien
Admin
Posts: 9846
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [iOS] PNG fatal error: CgBI: unhandled critical chunk

Post by CuteAlien »

Did it work before? Just wondering if it's something new or just something no one noticed before.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: [iOS] PNG fatal error: CgBI: unhandled critical chunk

Post by hendu »

http://stackoverflow.com/questions/2065 ... ical-chunk
The PNG you are trying to read has been run through Apple's "Xcode" version of pngcrush, which creates files that aren't PNGs. I believe Apple's pngcrush also has the capability of undoing the damage and more-or-less restoring the original PNG, using the "-revert-iphone-optimizations" option, although it's not mathematically possible to restore the color channels exactly for transparent or semitransparent pixels.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: [iOS] PNG fatal error: CgBI: unhandled critical chunk

Post by Vectrotek »

Hi! The previous post seems well informed, so I thought I might
mention this http://lodev.org/lodepng/ which is
a quite transparent resource on "*.png"..
I hope you can use it..
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

Re: [iOS] PNG fatal error: CgBI: unhandled critical chunk

Post by IrrlichtForiOS »

CuteAlien wrote:Did it work before? Just wondering if it's something new or just something no one noticed before.
We'd never tested it before, but in our first project it works well.

@All: We found the solution to this problem by setting "Compress PNG Files" to No in the Xcode-Targets Build Settings.
Post Reply