|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79786 clone of object is not cloning changed Colorspace
Submitted: 2020-07-04 13:19 UTC Modified: 2021-08-02 12:36 UTC
From: steve dot s at t-online dot de Assigned: cmb (profile)
Status: Feedback Package: imagick (PECL)
PHP Version: 7.3.19 OS: Debian 9
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: steve dot s at t-online dot de
New email:
PHP Version: OS:


 [2020-07-04 13:19 UTC] steve dot s at t-online dot de
Cloned object is still showing wrong colorspace Information.

Test script:
$objImage = new Imagick();
                    $objImage->setResolution(300, 300);
                $arrImageInfo = array();
                $arrImageInfo['type'] = $objImage->getImageType();
                $arrImageInfo['resolution'] = $objImage->getImageResolution();
                $arrImageInfo['resolutionUnit'] = $objImage->getImageUnits();
                $arrImageInfo['width'] = $objImage->getImageWidth();
                $arrImageInfo['height'] = $objImage->getImageHeight();
                $arrImageInfo['colorSpace'] = $objImage->getImageColorspace();
                $arrImageInfo['format'] = $objImage->getImageFormat();
if ($arrImageInfo['colorSpace'] != Imagick::COLORSPACE_RGB && $arrImageInfo['colorSpace'] != Imagick::COLORSPACE_SRGB && $arrImageInfo['colorSpace'] != Imagick::COLORSPACE_GRAY) {

$objThumb = clone $objImage;
$arrImageClone = array();
                $arrImageClone ['type'] = $objThumb->getImageType();
                $arrImageClone ['resolution'] = $objThumb->getImageResolution();
                $arrImageClone ['resolutionUnit'] = $objThumb->getImageUnits();
                $arrImageClone ['width'] = $objThumb->getImageWidth();
                $arrImageClone ['height'] = $objThumb->getImageHeight();
                $arrImageClone ['colorSpace'] = $objThumb->getImageColorspace();
                $arrImageClone ['format'] = $objThumb->getImageFormat();


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-05 13:09 UTC] rowan dot collins at gmail dot com
Please could you provide a clearer example, ideally one that can be reproduced easily to test potential fixes. Remember to include the _minimum_ code to reproduce the issue, the expected result, and the actual result - I'm assuming all these array assignments are irrelevant, and the actual test is to echo the value of $objThumb->getImageColorspace() immediately after cloning the object?
 [2021-08-02 12:36 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-02 12:36 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

See <>.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Aug 05 15:01:24 2021 UTC