|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-01 20:33 UTC] pecl-imagick at proneticas dot net
Description:
------------
When I try to open up a PNG with Imagick() I get an error:
corrupt image `/var/tmp/magick-2u3twpg7\' @ error/png.c/ReadPNGImage/3128
But if I run:
%> identify -verbose file/image.png
There are no errors. I convert the image, etc... This happens with any PNG file. I get a similar error if I try to create a blank PNG image as well.
I have rebuilt all the libraries and ImageMagick, the error is still there. Everything else works, I can open JPGs, TIFFs, BMPs, GIFs and PDFs without errors. I can edito those files without errors, it is strictly PNG files.
Reproduce code:
---------------
<?php
$image = new Imagick('file/image.png');
?>
Expected result:
----------------
PHP Imagick PECL Class to open the png file without errors.
Actual result:
--------------
ImagickException::__set_state(array(
'message' => 'corrupt image `/var/tmp/magick-2u3twpg7\' @ error/png.c/ReadPNGImage/3128',
'string' => '',
'code' => 1,
'file' => '_img.php',
'line' => 62,
'trace' =>
array (
0 =>
array (
'file' => '_img.php',
'line' => 62,
'function' => 'readimage',
'class' => 'Imagick',
'type' => '->',
'args' =>
array (
0 => 'file/image.png',
),
),
),
'previous' => NULL,
))
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
Hi, I have the same problem: Fatal error: Uncaught exception 'ImagickException' with message 'corrupt image `/var/tmp/magick-gv1Ygb98' @ error/png.c/ReadPNGImage/3102' in /home/u5000/test.php:12 Stack trace: #0 /home/u5000/test.php(12): Imagick->readimage('./obr.png') #1 {main} thrown in /home/u5000/test.php on line 12 From command line I can identify and convert without errors. This problem I have only with some png images, not all. Ports installed: php5-5.3.6 php-suhosin-0.9.32.1 pecl-imagick-3.0.1 ImageMagick-nox11-6.6.7.10_1 png-1.4.5Can you try with ->readImage (realpath ('./img.png')); just to exclude weird path resolving? Also does this happen just with PNG images?Getting the same problem: Linux classifieds1 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies ImageMagick version => ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org Git repo with bug/broken image https://github.com/Alan01252/broken_png_bug-59643 To reproduce php test.php Error message: PHP Fatal error: Uncaught exception 'ImagickException' with message 'corrupt image `2cbd0350d5c08a72911b8ca06103bb079d9e8b97e85f9571a90f55d59bd2d6a6693bfa62159791a6' @ error/png.c/ReadPNGImage/3723' ifieds.thefarmingforum.co.uk/public/common/web/upload/2c/bd/03/50/test.php on line Help greatly appreciated.