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 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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 22:01:30 2024 UTC