EXIF rotation data is stripped even when `preserveExifData` is true
Open
@andris-sevcenko is already working on this.
Since Oct 2, 2020.
bug
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
When an image is uploaded with EXIF rotation meta it is always set to \Imagick::ORIENTATION_UNDEFINED even when preserveExifData is true
Steps to reproduce
- Set
preserveExifDatatotrue - Upload an image containing EXIF rotation meta
- Download the image from its asset volume and check the EXIF data. Rotation will be set to
Unknown (0)
Additional info
Offending line is here:
Which sets to unknown, but the check to see whether the EXIF data should be preserved is inside ImageHelper::cleanExifDataFromImagickImage on the following line. The image is then resaved with the unknown rotation regardless of any settings.
This is also true if the image has been rotated by rotateImagesOnUploadByExifData although in that scenario the broken rotation meta doesn't cause any issues.
- Craft version: 3.5.6
- PHP version: 7.4
- Plugins & versions: ImageMagick
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.