|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62309 addImage() not working
Submitted: 2012-06-13 07:59 UTC Modified: 2016-05-20 21:55 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: carsten_sttgt at gmx dot de Assigned: vito (profile)
Status: Closed Package: gmagick (PECL)
PHP Version: 5.4.3 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 33 = ?
Subscribe to this entry?

 [2012-06-13 07:59 UTC] carsten_sttgt at gmx dot de

- PHP-5.4.3
- PECL gmagick-1.1.0RC3 (includes the attached patch)
- GraphicsMagick-1.3.13

Below is a working code with Imagick. But this doesn't work with Gmagick.

I'm unsure where to set the ImageFormat with Gmagick. For each frame or for the complete image right before the writeImage()?

With Imagick I'm setting the the format with setFormat() one time at the beginning, after "$gmagick = new Gmagick();". But setFormat() doesn't exists in Gmagick, and setImageFormat() doesn't work at this place, becourse the image is empty at this time(--> exception empty Gmagick object).


Test script:
$gmagick = new Gmagick();

for ($i = 1; $i <= 3; $i++) {
    $frame = new Gmagick();
    $frame->readImage(sprintf('test%s.jpg', $i));



$gmagick->writeImage('test.gif', true);


Expected result:
No exception.

Actual result:
[13-Jun-2012 07:48:12 UTC] PHP Fatal error:  Uncaught exception 'GmagickException' with message 'Can not process empty Gmagick object' in C:\Test\test.php:17
Stack trace:
#0 C:\Test\test.php(17): Gmagick->writeimage('test.gif', true)
#1 {main}
  thrown in C:\Test\test.php on line 17


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-10 15:08 UTC] imprec at gmail dot com
Helo, it seems you have to use it like this : 

$gmagick = new Gmagick();

for ($i = 1; $i <= 3; $i++) {
    $frame = new Gmagick();
    $frame->readImage(sprintf('test%s.jpg', $i));


It is an issue as Imagick works as you described it.
 [2013-04-10 19:48 UTC] imprec at gmail dot com
After having test more, my previous comment must be discarded as it's not solving 
the issue
 [2016-04-26 11:26 UTC] timon at dgngroep dot nl
Confirming this issue as well, as far as I am aware generating multi-page pdf files or animated gifs with Gmagick is broken because of this.
 [2016-05-20 21:55 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: vito
 [2016-05-20 21:55 UTC]

I think this is similar to:

See @Danack's note.

This had been reported upstream here:

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 05:01:31 2024 UTC