Forums / All Other Contributions/Addons / Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: pe_functions.php

Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: pe_functions.php

Locked

Started by skyline2 on 9 Apr 2010, 2:06 AM · Views: 9,827

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
9 Apr 2010, 2:06 AM
#1
skyline2 avatar

skyline2

New Zenner

Join Date:
Mar 2010
Posts:
9
Plugin Contributions:
0

Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: pe_functions.php

Hello,

I recently took over the maintenance of a ZenCart 1.3.8 site (PHP Version 5.2.6, MySQL 5.0.75), and in a customized add-on module, after selecting "Proceed to Checkout", I am getting the following error messages before the PayPal checkout page comes up:

Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib failed to initialize compressor -- stream error in .../htdocs/<module name>/pe_functions.php on line 34

Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in .../htdocs/<module name>/pe_functions.php on line 34
Processing please wait..........

Here is the referenced line 34 in the pe_functions.php file:
imagepng($im,"$filename",80);
... with this comment above it: //imagetruecolortopalette($im, true, 256); // set palette

I am completely stumped on how to troubleshoot this; I tried searching in the Developer's Toolkit for the various tags in the code but didn't find anything. I also found this posting in the forum: http://www.zen-cart.com/forum/showthread.php?t=106628&highlight=imagepng --- but nothing has been moved in this module, and it doesn't appear as though any files are missing.

Does anyone have a suggestion on how to fix this, or could someone please tell me how to troubleshoot this?

Thank you.

10 Apr 2010, 12:25 AM
#2
hey_you avatar

hey_you

New Zenner

Join Date:
Sep 2009
Posts:
49
Plugin Contributions:
0

Re: Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: pe_functions.php

I think the background of this error is a change in the imagepng php function. The quality parameter should now be between 0-9

Change the following line and give it a try

From

imagepng($im,"$filename",80);

To:

imagepng($im,"$filename",8);