Uncaught ImagickException's on readImageFile

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ashrafs
Posts: 6
Joined: 2018-01-03T06:53:29-07:00
Authentication code: 1152

Uncaught ImagickException's on readImageFile

Post by ashrafs »

Hello,

I'm having some problems with an updated ImageMagick installation where `readImageFile` produces a fatal error exception using the PHP API.

I've already had this working while running PHP 5.6 and the associated version of ImageMagick but recently updated to PHP 7.2 and updated the ImageMagick version as well.

I'm fetching an image stream from Amazon S3 with fopen and then reading the image file into ImageMagick using readImageFile:

Code: Select all

$blob = fopen('s3://' . $bucket . '/' . $prePath . urldecode($name), 'r');
$img = new Imagick();
$img->readImageFile($blob);
With a PNG image I'm getting error

Code: Select all

PHP Fatal error:  Uncaught ImagickException: improper image header `/var/tmp/magick-193308zvjjkKvCrJv' @ error/png.c/ReadPNGImage/4229
With a JPG image I'm getting error

Code: Select all

PHP Fatal error:  Uncaught ImagickException: insufficient image data in file `/var/tmp/magick-19454t7LA2q6pVdqv' @ error/jpeg.c/ReadJPEGImage/1106
Running
  • Mac OS X 10.12.6
  • PHP Version 7.2.0RC2
  • Compiled: ImageMagick 7.0.7-15 Q16 x86_64 2017-12-17
  • Running: ImageMagick 7.0.7-18 Q16 x86_64 2017-12-29
  • Imagick Module version: 3.4.3
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Uncaught ImagickException's on readImageFile

Post by snibgo »

I expect the developers will need a test that they can reproduce.
snibgo's IM pages: im.snibgo.com
Post Reply