php.net |  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
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:
Package:
Bug Type:
Summary:
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
Description:
------------
Cloned object is still showing wrong colorspace Information.

Test script:
---------------
$objImage = new Imagick();
                    $objImage->setResolution(300, 300);
                    $objImage->readImage($strSourceFilePath);
                $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) {
                     
$objImage->setImageColorSpace(Imagick::COLORSPACE_RGB);
}

$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();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 05:01:23 2020 UTC