Skip to content

Commit

Permalink
Save all images in SRGB color space with Imagick driver
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Oct 21, 2023
1 parent f73d1a2 commit 00d53e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Drivers/Imagick/Encoders/JpegEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public function encode(ImageInterface $image): EncodedImage
$imagick->setCompressionQuality($this->quality);
$imagick->setImageCompressionQuality($this->quality);

if ($imagick->getImageColorspace() != Imagick::COLORSPACE_SRGB) {
$imagick->transformImageColorspace(Imagick::COLORSPACE_SRGB);
}

return new EncodedImage($imagick->getImagesBlob(), 'image/jpeg');
}
}

0 comments on commit 00d53e2

Please sign in to comment.