Well, seems that at some point between PHP 4.4 and PHP 5, something about my libgd, libpng or zlib broke, because now I’m getting all these
PHP Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in ...
errors popping up. I know it worked a while ago. Not sure why it’s not working now though.
Great, something else to dig into. One of these days I’m just going to have to break down and redo the whole server.
Discover more from Imablog
Subscribe to get the latest posts sent to your email.
Did you ever get this fixed ??? I am running into the same trouble and tried to reinstall all the directories with no success !!
Thanks
Nope, haven’t got it fixed yet, although I haven’t had much time to spend on it. Did rebuild libz, libgd, libpng, libtiff and libjpeg from the latest sources, but no joy yet. Haven’t tried to rebuild PHP yet, but it’s on the list of things to do.
PHP 5.1.x added the optional* property of ‘compression’ for png’s. However, it doesn’t seem to be optional.
So instead of using: imagepng($img);
You have to use: imagepng($img, null, 9);
9 is the maximum compression, 0 is none.
That should fix your problem.