From bc704e822163e7f8e182531f36acc176b78f0281 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 16 Apr 2023 10:13:13 -0700 Subject: [PATCH] frmagick: ensure correct colorspace Signed-off-by: Varun Patil --- lib/Service/FileRobotMagick.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Service/FileRobotMagick.php b/lib/Service/FileRobotMagick.php index 63208c6c..ec56a4e3 100644 --- a/lib/Service/FileRobotMagick.php +++ b/lib/Service/FileRobotMagick.php @@ -148,6 +148,11 @@ class FileRobotMagick public function apply() { + // Ensure the image is in the correct colorspace + if (\Imagick::COLORSPACE_SRGB !== $this->image->getColorspace()) { + $this->image->transformImageColorspace(\Imagick::COLORSPACE_SRGB); + } + $this->applyCrop(); $this->applyFlipRotation(); $this->applyResize();