7

Metadata is information about an image, and can be included in JPEG image files.

EXIF metadata is information about the image recorded directly from the camera – for example, the exposure time and the date the photo was taken.

WordPress preserves EXIF information in full size images loaded to your website. It will also extract the Exif data to make it available for plugin developers.

When WordPress uploads images, in addition to uploading the Full Size image it automatically creates several differently sized versions of the image. By default: a Large, Medium and Thumbnail version.

The problem is that Wordpress is stripping the EXIF data when resizing images. The resized images become "orphan".

An "orphan" work is a work to which copyright cannot be determined or a work where the determined copyright holder cannot be contacted.

In the era of responsive images, it cannot be that the solution to keep the EXIF data of an image is to use the image in full-size.

Question:

  • How to force Wordpress to keep EXIF data?

Digging further:

  • Is there a way to insert the EXIF data in resized images once they have been resized?
  • Is there a way to force wordpress to use another Image Processing System that is not stripping metadata from images?
1

3 Answers 3

3

This issue has been fixed with a filter in Wordpress 4.5. If you want to preserve the exif data when resizing use

add_filter ('image_strip_meta', false);
4
  • applies only to imagick and not GD image processing PHP libraries, so not a general solution Commented Sep 12, 2016 at 13:36
  • Or any other image library that you might want to install, but given that Imagick is the WP standard this will work for most people.
    – cjbj
    Commented Sep 12, 2016 at 13:54
  • I thought that GD was a standard for a long time which means that you will find it in many shared hostings. So depends on what is it that you want to do, one off solution or a general use plugin/theme Commented Sep 12, 2016 at 13:55
  • Yes, a general solution would include a script that fixes GD on this
    – cjbj
    Commented Sep 12, 2016 at 14:18
2

1) How to force Wordpress to keep EXIF data?

Use imagick instead of GD. If imagick is installed in your server, wordpress will use it instead of GD. Problem is, that many servers and shared hostings dont have imagick and the user has to install it, which can be a hassle. Many shared hostings don't even allow to install other php extensions. Some hostings provide imagick by default. It's always a great idea to check if the hosting has it (and if not, if its possible to install it) before attempting to build a website that will require such metadata.

Last time I did a project that required EXIF, my client had a server that didnt allow the installation of imagick. We migrated server, installed imagick and solved the issue.

There is an important note concerning regenerate thumbnails plugins: even if you have imagick installed in your server, some of these plugins will remove the metadata when regenerating images. Carefully read each plugin description and make sure they dont remove metadata before using them.


2) Is there a way to insert the EXIF data in resized images once they have been resized?

This metadata is stored in db tables, but why would you attempt to do that if you can keep the metadata using imagick?


3) Is there a way to force wordpress to use another Image Processing System that is not stripping metadata from images?

Yes, imagick.

-1

The work around is to simply download the images created by Wordpress to your computer, add the metadata with a program like Photoshop, and the upload them to the same folder, replacing the originals with the one now containing the metadata. It's not that convenient, but doesn't require any knowledge other than how to download files (I use FTP) and how to add metadata.

You won't be able to add back camera data, but you can add copyright information, credit information, and who to contact in order to get permission to use the photos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.