Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata stripped from transformed images #2034

Closed
evanwarner opened this issue Oct 12, 2017 · 10 comments
Closed

Metadata stripped from transformed images #2034

evanwarner opened this issue Oct 12, 2017 · 10 comments
Assignees
Labels
enhancement improvements to existing features rfc

Comments

@evanwarner
Copy link
Contributor

Description

Most of an image's metadata (including the important copyright info) is stripped out of an image when an asset transform is applied. This used to happen during asset uploading (see this old question, answered by @andris-sevcenko), but that has been resolved. Images downloaded directly from the CP, or loaded on a page without a transform applied still have their metadata intact.

Steps to reproduce

  1. Upload an image with full metadata (like anything exported from Lightroom)
  2. Use the image with an asset transform applied to it
  3. Download the transformed image and check the metadata

Additional info

  • Craft version: 2.6.2991
  • PHP version: 5.5.38
  • Database driver & version: MySQL 5.7.11
  • Plugins & versions: Contact Form 1.8.1, Craft Fetch 1.0
@andris-sevcenko andris-sevcenko self-assigned this Oct 13, 2017
@brandonkelly
Copy link
Member

I could see this being a config setting, or an advanced transform setting @andris-sevcenko. Probably more of a 3.0 change than 2.x though.

@andris-sevcenko
Copy link
Contributor

Since in Craft 3 this is accomplishable with a plugin making the use of the assetTransforms.generateTransform event, we're not going to address this now. I'm leaving this issue open, however, because we're still undecided about this in the long run.

@andris-sevcenko andris-sevcenko added rfc enhancement improvements to existing features labels Oct 16, 2017
@evanwarner
Copy link
Contributor Author

For what it's worth, I'd vote for preservation of image copyright info to be a core feature, even in 2.x as it will still be some time before that version is obsolete (and it will remain relevant for clients who don't want to foot the bill of upgrading to 3.x). The rest of the stripped metadata I'm fine with being opt-in if you want to use it for something on the front-end, but copyright metadata has legal ramifications for people (chiefly photographers) who are trying to protect their work.

Photographers who register their work with the US Copyright Office are afforded additional legal avenues to seek damages for copyright infringement. One of the ways they can do this is by showing that copyright information was willfully removed from their images by an infringer. But if your own website strips that information, it's one less tool you have.

This issue has been a concern of mine for a while as I slowly work towards launching my own photography site, and it was also voiced to me by a current designer/photographer client who noticed his info being stripped on his site (which is already live).

@andris-sevcenko
Copy link
Contributor

@evanwarner When the next Craft 2.6 release hits (should be today), keep an eye out for preserveExifData config setting. As long as you set that to true and are using Imagick instead of GD, you should be able to preserve all EXIF metadata for transforms.

@narration-sd
Copy link
Contributor

nice job, @andris-sevcenko -- photo people will appreciate

@evanwarner
Copy link
Contributor Author

Cheers @andris-sevcenko! Thanks so much, my client will be happy to hear this (as am I).

andris-sevcenko added a commit that referenced this issue Oct 18, 2017
@evanwarner
Copy link
Contributor Author

@andris-sevcenko can you confirm this fix is working? My client's Server Info page verifies ImageMagick is installed and available. I cleared all caches, deleted transformed images and updated asset indexes. But newly transformed images still have stripped down metadata.

I'm specifically looking for retention of the Artist, Copyright, Copyright Notice, Creator, and Rights metadata fields.

@andris-sevcenko
Copy link
Contributor

@evanwarner Are you using https://craftcms.com/changelog#2-6-2993 and have you enabled the config setting? Another thing, if this is an external source, you'll probably need to re-upload the file to clear the transform source cache.

If none of that works, can you send a file over to support that has these fields and loses them on transforming?

@evanwarner
Copy link
Contributor Author

Yep, v2.6.2993, with 'imageDriver' => 'imagick' and 'preserveExifData' => true both set. Images are stored locally on the webserver. I'll send a test image along and reference this issue in the message.

@evanwarner
Copy link
Contributor Author

v2.6.2994 seems to have fixed it. I need to do more in-depth testing but basic copyright info is kept in place during transforms. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features rfc
Projects
None yet
Development

No branches or pull requests

4 participants