Imagick / imagick

🌈 The Imagick PHP extension 🌈
http://pecl.php.net/imagick
Other
548 stars 140 forks source link

Color bug in newest version #632

Open Marduksen opened 1 year ago

Marduksen commented 1 year ago

After my host updated to one of the newest versions, the colors suddently. They have looked a bit into it and write the following: "The nature of the problem is simply an error in the interaction between Imagick (the PHP extension) and ImageMagick (the software library). In concrete terms, it seems to be the color management when converting from SVG, and with the red and green channels."

Left is how it looks now & Right red box, is how it should look (php example below the image): imagick

<?php $svg = '<svg width="200" height="200" viewBox="0 0 200 200"> <rect x="0" y="0" width="100" height="100" fill="#FF0000" /> </svg>'; $im = new Imagick(); $im->setResolution(96, 96); $im->setBackgroundColor(new ImagickPixel("transparent")); $im->readImageBlob($svg); $im->setImageFormat('png'); header("Content-Type: image/png"); echo $im->getImageBlob();

image

Danack commented 1 year ago

You should try reproducing the error using the command line ImageMagick tools. If the error still occurs you should report it upstream at https://github.com/ImageMagick/ImageMagick6

If you can't reproduce on the command line ImageMagick tools, you should probably ask your host to always upgrade Imagick and ImageMagick together.

Screenshot 2023-10-03 at 19 32 41

Some of the identifiers change values in patch versions, and it is really not guaranteed that Imagick compiled against one version of ImageMagick is going to work with a different version of ImageMagick.

Marduksen commented 1 year ago

thanks for that

Danack commented 1 year ago

@Marduksen I should have asked, did either of those bits of info help?