Showing posts with label php png image resizing zlib error WP-SimpleViewer-Gallery. Show all posts
Showing posts with label php png image resizing zlib error WP-SimpleViewer-Gallery. Show all posts

Wednesday, 6 June 2007

gd-png: fatal libpng error: zlib error

When upgrading php from php4 to php5, the following error occurs;

gd-png: fatal libpng error: zlib error

I've found the solution - so I thought i'd post it here to help others.

In php5, the quality range changes for imagePNG from 0-99 to 0-9. therefore you need to change your code to relect this, e.g.

imagePNG('','', 9);

(instead of imagePNG('','',90)) - I divided the quality value by 10 and then round or floor the value accordingly.