php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62308 readImageFile not working and writeImageFile/writeImagesFile are missing
Submitted: 2012-06-13 07:38 UTC Modified: 2012-06-13 08:12 UTC
From: carsten_sttgt at gmx dot de Assigned:
Status: Open Package: gmagick (PECL)
PHP Version: 5.4.3 OS: Windows 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: carsten_sttgt at gmx dot de
New email:
PHP Version: OS:

 

 [2012-06-13 07:38 UTC] carsten_sttgt at gmx dot de
Description:
------------
Hello,

- PHP-5.4.3
- PECL gmagick-1.1.0RC3
- GraphicsMagick-1.3.13

readImageFile() isn't working with a correct filepointer.

And even it it's working, the correspondending writeImageFile/writeImagesFile are missing.


If I change:
    $gmagick->readImageFile($fp);

to:
    $gmagick->readImageBlob(stream_get_contents($fp));

it's working.

BTW: Of course, $gmagick->__toString() is working. But it would be nice to have a correspondending getImageBlob like in Imagick.


Regards,
Carsten


Test script:
---------------
<?php
    $fp = fopen('test1.jpg', 'rb');
    
    $gmagick = new Gmagick();
    $gmagick->readImageFile($fp);
?>


Expected result:
----------------
No exception.


Actual result:
--------------
[13-Jun-2012 07:25:43 UTC] PHP Fatal error:  Uncaught exception 'GmagickException' with message 'Not a JPEG file: starts with 0x2a 0xd1 ()' in C:\Test\test.php:5
Stack trace:
#0 C:\Test\test.php(5): Gmagick->readimagefile(Resource id #3)
#1 {main}
  thrown in C:\Test\test.php on line 5


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-13 08:12 UTC] carsten_sttgt at gmx dot de
-Summary: readImageFile not working and writeImageFile/writeImagesFile +Summary: readImageFile not working and writeImageFile/writeImagesFile are missing
 [2012-06-13 08:12 UTC] carsten_sttgt at gmx dot de
-
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 08:01:24 2019 UTC