PHP fatal errors in imagepng()

I upgraded to PHP 5.2 from 4.3 recently and came across a couple of error messages: php[7028], PHP Warning: imagepng(): gd-png: fatal libpng error: zlib error in … followed by: php[7028], PHP Warning: imagepng(): gd-png error: setjmp returns error condition in …

Turns out the paramters for imagepng changed in PHP 5.1.3, and I’m not sure what the third argument used to be, but where I had imagepng($image, null, 100) it died, because the third argument (quality) is supposed to be 0 to 9 now.

I came across postings saying to replace DLL files and all this nonsense, but all I needed to do was change the 100 to a 9.

2 Replies to “PHP fatal errors in imagepng()”

  1. Статья оставила сложное, даже в какой-то степени неоднозначное, впечатление… Даже не знаю, что сказать… Нужно время, чтобы обдумать прочитанное.

  2. Emily Dawidowicz – Brantford, Ontario Canada – I am a content creator and I build & design responsive websites. I have a vested interest in the health and wellness space and I am facinated with new tech and learning AI automations.
    emily says:

    Thanks for that…you really helped me out, I’ve been trying to find a solution to that issue for a few days now.

Comments are closed.