Getting this error?
PHP Fatal error: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in example.php on line 10
Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number – instead of the PHP 4 1-100 standard.
It should work smoothly now :)
Joe —
It works like heaven. Thank you.
Jatin —
Yes…the solution works. Had the same problem while migrating from php4 to php5
Thanks
jatin
vic —
thanks dude … my code works nicely now!
fedora_rocks —
YES! thanks dude!
David Barnes —
Actually, 10 causes this error too. Set it to 9 to fix this problem.
Blake —
Hey Jamie, thanks for taking the time to post this. You came up quite high on Google for this error message. Within less than a minute of encountering it in a project I’m working on, I was able to remedy it, thanks to your post.
Kudos!
RaYa —
Hey, thx.. i used 7 and its works fine ^^
Pece —
Works with values 0-9.
Thanks!
creed —
Thanks for the fix! Tried it with 9 (after it not working with 10) and it worked like a charm. Gotta love easy solutions! Thanks again!
Vaibhav —
Thank you so much! This one problem took two days of my life away :/
Sham —
Thank you for posting this, you’re a life saver!
Pingback on
Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error « Leonel Santos