|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59420 invalid setimageformat!
Submitted: 2010-09-15 03:42 UTC Modified: 2010-10-03 05:01 UTC
From: hi dot laowang at gmail dot com Assigned: vito (profile)
Status: Closed Package: gmagick (PECL)
PHP Version: 5.3.2 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hi dot laowang at gmail dot com
New email:
PHP Version: OS:


 [2010-09-15 03:42 UTC] hi dot laowang at gmail dot com
when I change gif animated picture from gif to png.
no change happened.

Reproduce code:
        $image_handle = new Gmagick();



Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-15 06:05 UTC] hi dot laowang at gmail dot com

can't get gif animated picture
 [2010-09-19 12:29 UTC]
For the description at 2010-09-15 07:42 UTC, you will be able to get to echo the image as a PNG by doing:

header("Content-Type: image/png");
echo $image;

Make sure you have the decode delegate for PNG available. If you write() an image that is read from a blob that is originally GIF, but changed to PNG via setImageFormat(), you should get multiple PNG files corresponding to the number of images in the GIF. For example, if example.gif is a 2 image GIF, the following:

$file = "example.gif";
$firstHandle = new Gmagick($file);
$firstBlob = $firstHandle->getImageBlob();
$secondHandle = new Gmagick();
$secondBlob = $secondHandle->getImageBlob();
$thirdHandle = new Gmagick();

will yield:

 [2010-10-03 05:01 UTC]
Thank you for taking the time to write to us, but this is not
a bug.

As for the additional comment on 2010-09-15 10:05 UTC; as per GraphicsMagick documentation, addImage() adds the specified image at the current image location. You'll need to use nextImage() to create the image location and previousImage() to return to the location where you'll want the GIF creation to occur. If you have many images, it is important to manage the wand location properly. Here's an example:

$first = new Gmagick("example.0.png");
$second = new Gmagick ("example.1.png");
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 21:01:30 2024 UTC