"corrupt image" when trying to create a PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bradleye
Posts: 1
Joined: 2011-04-03T06:36:43-07:00
Authentication code: 8675308

"corrupt image" when trying to create a PNG

Post by bradleye »

Hi Guys,

Im getting the following error when trying to create a PNG image using Imagick (using PHP).

Code: Select all

Fatal error: Uncaught exception 'ImagickException' with message 'corrupt image `/tmp/magick-uQj1QpOB' @ error/png.c/ReadPNGImage/3134' in /var/www/vhosts/domain.net/httpdocs/classes/main.class.php:475 Stack trace: #0 /var/www/vhosts/domain.net/httpdocs/classes/main.class.php(475): Imagick->__construct('/var/www/vhosts...') #1 /var/www/vhosts/domain.net/httpdocs/admin/classes/admin.class.php(606): Main->MakeThumb('120', '50', '/var/www/vhosts...', '/var/www/vhosts...', 'image/png') #2 /var/www/vhosts/domain.net/httpdocs/admin/editcompany.php(51): Admin->EditCompany() #3 {main} thrown in /var/www/vhosts/domain.net/httpdocs/classes/main.class.php on line 475
Anyone know what causes this and how to resolve?

Thanks,
Bradley
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: "corrupt image" when trying to create a PNG

Post by anthony »

The first line is a standard ImageMagick error saying the PNG image it was reading was bad.

The rest is coming from the wrappers around the core library. Looks like PHP IMagick was used by a PHP script.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply