php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61879 Imagick writeImages no longer works with PHP5.4
Submitted: 2012-04-30 08:15 UTC Modified: 2012-05-30 20:15 UTC
Votes:4
Avg. Score:3.2 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: mail at jdborg dot com Assigned: mkoppanen (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 5.4.1 OS: Linux
Private report: No CVE-ID: None
 [2012-04-30 08:15 UTC] mail at jdborg dot com
Description:
------------
I'm using PHP 5.4.0 (it's not in the list above).  The test script attached used to work, but now I only get the one frame (as if I'd done writeImage()) saved.  If I do an echo, the image is animating so this (as far as I can see) is an issue only with writeImages().

Test script:
---------------
$gif = new Imagick();
$gif->setFormat("gif");

foreach ($files as $file) {
    $frame = new Imagick();
    $frame->readImage($file);
    $gif->addImage($frame);
    $gif->setImageDelay(1);
}

$path = "/any/path/will/do/animation.gif";
$gif->writeImages($path,true);


Expected result:
----------------
A gif file written to the path specified that's animated.

Actual result:
--------------
A gif file written to the path specified that's not animated.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-08 12:57 UTC] AntonShevchuk at gmail dot com
Reproduced on PHP Version 5.4.2
 [2012-05-20 12:11 UTC] pinnaclecomps+php at gmail dot com
I can reproduce the issue in PHP 5.4.3 with the latest imagick SVN revision 
(325591)
 [2012-05-28 20:49 UTC] jobklaassen at hotmail dot com
Same problem on PHP 5.4.3. Only writes first frame.
 [2012-05-29 13:10 UTC] jobklaassen at hotmail dot com
Looked at the source and fixed the problem. 

In imagick_class.c on line 7825 you will find:
"status = php_imagick_write_file(intern, &file, ImagickWriteImage, adjoin TSRMLS_CC);"

Change to:
"status = php_imagick_write_file(intern, &file, ImagickWriteImages, adjoin TSRMLS_CC);"

Solves this issue.
 [2012-05-29 14:54 UTC] mail at jdborg dot com
So change that line and rebuild?
 [2012-05-30 20:15 UTC] mkoppanen@php.net
Automatic comment from SVN on behalf of mkoppanen
Revision: http://svn.php.net/viewvc/?view=revision&revision=325896
Log: Fixes PHP bug #61879
 [2012-05-30 20:15 UTC] mkoppanen@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mkoppanen
 [2012-05-30 20:15 UTC] mkoppanen@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC