<p>Currently the images are being cleansed on upload, which means that they are being re-saved to make sure that no malicious code is injected in them.</p>

<p>Unfortunately, this means that EXIF data gets stripped out along the way, but since Craft already uses <a href="https://github.com/lsolesen/pel" rel="nofollow" title="PEL">PEL</a>, it should be possible to tweak Craft a bit so that the EXIF metadata is preserved during this operation. We'll look into that and, hopefully, this will make it to a release pretty soon.</p>

CC BY-SA 3.0
2015-07-24T12:44:32.023Z
Thanks, and good to hear it shouldn't be hard to fix. Currently this is a dealbreaker for me using Craft on a few sites.
Evan Warner
CC BY-SA 3.0
2015-07-24T13:09:22.023Z
@EvanWarner, Andris: I'm not exactly sure what you both are talking about, as I have a lot of EXIF metadata, that I can access from uploaded assets with my plugin [Asset Metadata](https://github.com/carlcs/craft-assetmetadata) (uses the library [getID3](http://getid3.sourceforge.net)). Why does this work for me?
carlcs
CC BY-SA 3.0
2015-07-24T17:59:33.447Z
@carlcs: Not sure why it works for you but I'd love to find out. [Here's a diff](https://gist.github.com/evanwarner/8e138896a52cf47d9e0e) of my image EXIF pre- and post-upload.
Evan Warner
CC BY-SA 3.0
2015-07-25T10:06:33.957Z
@carlcs, are these assets uploaded via Craft or uploaded outside of Craft and indexed thereafter?
Andris Sevcenko
CC BY-SA 3.0
2015-07-25T11:59:08.307Z
Uploaded from the CP. ImageMagick is installed, if that matters.
carlcs
CC BY-SA 3.0
2015-07-24T05:20:45.897Z
2015-07-24T05:20:45.897Z
Andris Sevcenko
<p>For Craft 3 the setting 'preserveExifData' in config/general.php should be <a href="https://docs.craftcms.com/api/v3/craft-config-generalconfig.html#public-properties" rel="nofollow noreferrer">set to true</a></p>

CC BY-SA 4.0
2019-08-12T13:46:31.637Z
2019-08-12T13:46:31.637Z
Niek
<p>I've got a clean install of Craft with just some initial configuration of entry types, categories, assets, etc.</p>

<p>Any image I upload (either directly into assets or via an image field) has almost all of its EXIF metadata stripped out. Most of the removed info I don't care about, but it's essential that the embedded copyright, geolocation and keyword information is retained.</p>

<p>I assume this has something to do with the configuration of ImageMagick/GD (whichever Craft uses by default). Is there a way I can create a configuration that specifies which EXIF fields to preserve in the uploaded image?</p>

<assets><upload>
Uploaded images stripped of EXIF data
# Uploaded images stripped of EXIF data

(Asked by: username_0 on 2015-07-23)

I've got a clean install of Craft with just some initial configuration of entry types, categories, assets, etc.

Any image I upload (either directly into assets or via an image field) has almost all of its EXIF metadata stripped out. Most of the removed info I don't care about, but it's essential that the embedded copyright, geolocation and keyword information is retained.

I assume this has something to do with the configuration of ImageMagick/GD (whichever Craft uses by default). Is there a way I can create a configuration that specifies which EXIF fields to preserve in the uploaded image?

**Tags:** assets, upload

---

## 2 answers

### Answer by username_1 on 2015-07-24. Score: 3 | Accepted answer

Currently the images are being cleansed on upload, which means that they are being re-saved to make sure that no malicious code is injected in them.

Unfortunately, this means that EXIF data gets stripped out along the way, but since Craft already uses [PEL](https://github.com/lsolesen/pel "PEL"), it should be possible to tweak Craft a bit so that the EXIF metadata is preserved during this operation. We'll look into that and, hopefully, this will make it to a release pretty soon.

> **Comments:**
> **username_0**: Thanks, and good to hear it shouldn't be hard to fix. Currently this is a dealbreaker for me using Craft on a few sites.  
> **username_2**: @EvanWarner, Andris: I'm not exactly sure what you both are talking about, as I have a lot of EXIF metadata, that I can access from uploaded assets with my plugin [Asset Metadata](https://github.com/carlcs/craft-assetmetadata) (uses the library [getID3](http://getid3.sourceforge.net)). Why does this work for me?  
> **username_0**: @carlcs: Not sure why it works for you but I'd love to find out. [Here's a diff](https://gist.github.com/evanwarner/8e138896a52cf47d9e0e) of my image EXIF pre- and post-upload.  
> **username_1**: @carlcs, are these assets uploaded via Craft or uploaded outside of Craft and indexed thereafter?  
> **username_2**: Uploaded from the CP. ImageMagick is installed, if that matters.  

---

### Answer by username_3 on 2019-08-12. Score: 2

For Craft 3 the setting 'preserveExifData' in config/general.php should be [set to true](https://docs.craftcms.com/api/v3/craft-config-generalconfig.html#public-properties)


---

