php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64015 Cloning Imagick object returns 0 for getImageLength() and getImageSize()
Submitted: 2013-01-18 04:04 UTC Modified: 2013-09-30 05:59 UTC
From: isaac at silverorange dot com Assigned: mkoppanen (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 5.3.21 OS: CentOS 6.3
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: isaac at silverorange dot com
New email:
PHP Version: OS:

 

 [2013-01-18 04:04 UTC] isaac at silverorange dot com
Description:
------------
Running  imagick 3.1.0RC2

Issue:
Cloning Imagick object returns 0 for getImageLength() and getImageSize()

This is broken with clone() method and clone keyword. Previous versions would return correct filesize.

Test script:
---------------
<?php
$im = new Imagick('http://static.php.net/www.php.net/images/php.gif');

// Both should return filesize in bytes.
echo "Original\n";
echo 'getImageLength: '.$im->getImageLength()."\n";
echo 'getImageSize: '.$im->getImageSize()."\n";

// All cases below now return 0;
$cloned_im = clone $im;
echo "clone Keyword\n";
echo 'getImageLength: '.$cloned_im->getImageLength()."\n";
echo 'getImageSize: '.$cloned_im->getImageSize()."\n";


$cloned_im_by_method = $im->clone();
echo "clone Method\n";
echo 'getImageLength: '.$cloned_im_by_method->getImageLength()."\n";
echo 'getImageSize: '.$cloned_im_by_method->getImageSize()."\n";

?>

Expected result:
----------------
Cloned object methods should return correct filesize.

Actual result:
--------------
Methods return 0 instead of correct filesize.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-18 04:18 UTC] mkoppanen@php.net
I just tested this and seems to work fine. What ImageMagick version are you using?
 [2013-01-18 04:23 UTC] mkoppanen@php.net
Just noticed that my test script had a typo, which appeared to make it working. I 
will check the issue again and get back to you
 [2013-01-18 04:26 UTC] isaac at silverorange dot com
For the record, I'm $im->getVersion() returns:

versionNumber => 1620
versionString => ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP 
http://www.imagemagick.org
 [2013-01-22 03:05 UTC] mkoppanen@php.net
Please see http://www.imagemagick.org/discourse-server/viewtopic.php?
f=3&t=22626&p=94501#p94501
 [2013-09-30 05:59 UTC] mkoppanen@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mkoppanen
 [2013-09-30 05:59 UTC] mkoppanen@php.net
This is upstream behaviour
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 17:01:33 2025 UTC