[php-src] Issue #15636: Is any way to clone GDResource/GDImage object without black magic of imgcopy?

From: Date: Thu, 29 Aug 2024 13:16:21 +0000
Subject: [php-src] Issue #15636: Is any way to clone GDResource/GDImage object without black magic of imgcopy?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247629@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/15636 Author: KarelWintersky ### Description I want do something like this: ``` $f0 = (new Image('test.jpg'))->load()->setQuality(90); $f1 = $f0->applyFilter(IMG_FILTER_GRAYSCALE) ->setFilename('test_grayscale_1.jpg') ->save(); $f2 = $f0->applyFilter(IMG_FILTER_NEGATE) ->setFilename('test_inverted.jpg') ->save(); $f3 = $f0->applyFilter(IMG_FILTER_GRAYSCALE) ->setFilename('test_grayscale_2.jpg') ->save(); ``` now, test_grayscale2.jpg is inverted AND grayscale, not an only grayscale, as expected. Is any way to clone GDImage resource without black magic like imgcopy, imgcrop, etc?

« previous php.bugs (#247629) next »