craftcms / craftcms/cms

Image::cleanImageByPath converting large CMYK Tiff to RGB, ignoring general settings

Open
#6,301 0 comments 0 reactions 1 assignee View on GitHub

@andris-sevcenko is already working on this.

Since Jul 1, 2020.

bug
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
  1. Download linked file above
  2. Set config as above
  3. Upload image file to craft volume
  4. View the file to see the obvious color difference, or download it to local machine and inspect colorspace, see RGB
Additional info
original saved
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.