|  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: -
From: steve dot s at t-online dot de Assigned:
Status: Open Package: imagick (PECL)
PHP Version: 7.3.19 OS: Debian 9
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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?
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 05:01:23 2021 UTC