php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58948 Unable to read image from the filehandle
Submitted: 2009-11-12 12:03 UTC Modified: 2010-01-27 14:50 UTC
From: rolosworld at gmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.10 OS: Ubuntu 9.10
Private report: No CVE-ID: None
 [2009-11-12 12:03 UTC] rolosworld at gmail dot com
Description:
------------
Imagick::readImageFile fails to read an opened file handler.

Reproduce code:
---------------
<?php
$f = fopen('ble.png', 'rb');
$img = new Imagick();
$img->readImageFile( $f );
$img->writeImage('foo.png');
fclose($f);
?>

Expected result:
----------------
Read the opened file handler and create a PNG file named  foo.png

Actual result:
--------------
PHP Fatal error:  Uncaught exception 'ImagickException' with message 'Unable to read image from the filehandle' in /home/rolo/public_html/tmp/imagick.php:4
Stack trace:
#0 /home/rolo/public_html/tmp/imagick.php(4): Imagick->readimagefile(Resource id #5)
#1 {main}
  thrown in /home/rolo/public_html/tmp/imagick.php on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-13 00:37 UTC] silvein at gmail dot com
I'm having the same problem in 5.3.1
 [2010-01-27 14:50 UTC] mkoppanen@php.net
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 [2011-05-06 06:25 UTC] loranger at free dot fr
While using PHP 5.3.7 with Imagick 2.3.0, I still have this issue.
 [2011-05-06 06:27 UTC] loranger at free dot fr
Ok, this was fixed in Imagick 3.0.0 RC1, sorry for bothering
 [2014-09-26 22:17 UTC] luke32j at msn dot com
Same problem persists on Windows-7, Xampp php 5.4.4, Imagick 3.1.0RC2, ImageMagick 6.6.5-9 2010-11-15 Q16 http://www.imagemagick.org

It does work, when using new Imagick('filenamehere') where filenamehere is not a url.

Anyone know what prevents it from being able to readImageFile of  fopen of a url? Or a file for that matter.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC