Image::cleanImageByPath converting large CMYK Tiff to RGB, ignoring general settings
@andris-sevcenko is already working on this.
Since Jul 1, 2020.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
I've been struggling with this issue today. When I upload a large CMYK TIFF image to a standard volume (example file here) , the final image is converted to RGB color space, and the colors are off. (Attaching thumbnails of before and after). I've set my config values as such:
'preserveImageColorProfiles' => true,
'preserveCmykColorspace' => true,
'optimizeImageFilesize' => false,
'preserveExifData' => true,
'maxCachedCloudImageSize' => 0,
'rotateImagesOnUploadByExifData' => false
but the issue persists. Only if I comment out the Image::cleanImageByPath call in craft\elements\Asset->afterSave does the image save as expected. I did some code diving to see if I could pinpoint whether there was a transformation or something that was obviously triggering it, but couldn't turn up anything. Not sure if this is an issue with ImageMagick or not.
Steps to reproduce
- Download linked file above
- Set config as above
- Upload image file to craft volume
- View the file to see the obvious color difference, or download it to local machine and inspect colorspace, see RGB
Additional info
| PHP version | 7.4.1 |
|---|---|
| Darwin 19.4.0 | |
| MySQL 5.7.26 | |
| Imagick 3.4.3 (ImageMagick 6.9.6-2) | |
| Craft Pro 3.4.22.1 | |
| 2.0.35 | |
| 2.12.5 | |
| 6.5.4 | |
| 1.2.3-dev |
No plugins except redactor
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.