(Running Drupal 6.14 on a LAMP server, PHP5.2.11.
phpinfo() shows GD version as 'bundled (2.0.34 compatible)' with PNG support enabled.)

I notice this issue with imagecache but I think it's an ImageAPI GD issue. If I try to save a preset it gives me the following errors (I think as a result of trying to manipulate the PNG sample):

    * warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: [00][00][00][00]: unknown critical chunk in /xxxxxxxxx/sites/all/modules/imageapi/imageapi_gd.module on line 44.
    * warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in /xxxxxxxxx/sites/all/modules/imageapi/imageapi_gd.module on line 44.
    * warning: imagecreatefrompng() [function.imagecreatefrompng]: 'sites/default/files/imagecache_sample.png' is not a valid PNG file in /xxxxxxxxx/sites/all/modules/imageapi/imageapi_gd.module on line 44.

Also, if I try to upload a PNG image into an image field, it says 'An image thumbnail was not able to be created.'

The issue appears to be restricted only to PNGs.

This issue may have something to do with it?

Comments

mmbee888’s picture

it happens to me too using 6.15 and uninstall all the imagecache modules and reinstall them again will work. Weird!!! Hope they look into the problems.

HnLn’s picture

subscribe (I have the same problem):

GD library undled (2.0.34 compatible)
I do have a GD Memory Limit warning, I'll update if increasing it resolves anything.

webfunkin’s picture

Priority: Normal » Major

I have the same problem.
using drupal 6.20.
PHP 5.2.13
GD - bundled (2.0.34 compatible)
Php memory limit - 128M

error :
warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: Read Error: truncated data in xxxx/sites/default/modules/imageapi/imageapi_gd.module on line 44.
warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in xxxx/sites/default/modules/imageapi/imageapi_gd.module on line 44.
warning: imagecreatefrompng() [function.imagecreatefrompng]: 'sites/default/files/rick.png' is not a valid PNG file in xxxx/whackkc1/public_html/sites/default/modules/imageapi/imageapi_gd.module on line 44.

please do look into it

hejazee’s picture

I had the same problem.

imagecreatefrompng() [function.imagecreatefrompng]: 'sites/default/files/imagecache_sample.png' is not a valid PNG file in /home/.../sites/all/modules/imageapi/imageapi_gd.module on line 59.
imagecreatefrompng() [function.imagecreatefrompng]: 'sites/default/files/imagecache_sample.png' is not a valid PNG file in /home/.../sites/all/modules/imageapi/imageapi_gd.module on line 59.

But I solved it by deleting and re-uploading the sample.png file at this location:
sites/default/files/imagecache_sample.png
That file was corrupted and hadn't been uploaded successfully to my server.
Some of its pixels were damaged.

danesta’s picture

After hours of trial and error I stumbled across this thread and can confirm that #4 worked for me, thanks!

HeathN’s picture

Issue summary: View changes

Can confirm that #4 works, but this is not a solution. Also this is an issue in 7.x as well.