Cms: Metadata stripped from transformed images

Created on 13 Oct 2017  路  10Comments  路  Source: craftcms/cms

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
enhancement rfc

Most helpful comment

@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.

All 10 comments

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.

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.

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).

@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.

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

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

@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.

@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?

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.

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darylknight picture darylknight  路  3Comments

michaelhue picture michaelhue  路  3Comments

angrybrad picture angrybrad  路  3Comments

leigeber picture leigeber  路  3Comments

lukebailey picture lukebailey  路  3Comments