Neutral Axis

Stripping EXIF Data from Photos Before Uploading

by on Nov.29, 2011, under Uncategorized

While uploading some photos recently for a post from my iPhone, it dawned on me that being taken with the iPhone, they had GPS metadata in them.  Sites like Facebook routinely strip that data from uploaded photos, but I wondered if WordPress did.  Nope.

The easiest way I knew to quickly verify this was to download a photo I had recently uploaded to NeutralAxis and have Picassa map it.  Sure enough, it located exactly where that photo had been taken.

This metadata in digital photos is called EXIF data.  Searching WordPress plugins for EXIF turned up two that were promising,  “EXIF-Remove”, and  “EXIF-Remove-Imagemagick”.  “EXIF-Remove” wasn’t compatible with the current version of WordPress.  EXIF-Remove-Imagemagick said it was.

After installing the plugin I went to it’s settings and found two errors.  It couldn’t find an Image engine nor Imagick PHP module, and thus couldn’t activate.  I have access to my webserver, so two commands later, everything was working fine.

sudo apt-get install imagemagick
sudo apt-get install php5-imagick

With that plugin activated, any photo I upload will have all the EXIF data removed, not just GPS location. And I’m OK with that.

However, what about previous photos I may have uploaded?  This plugin only works during upload, and won’t scan photo folders for other files to strip.  For that I found “jhead”.

sudo apt-get install jhead

With it installed, you just need to navigate to the folder where your photos are kept and run

jhead -purejpg *.jpg

Other options are presented here.

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


A few highly recommended websites...