Pop Culture•Music•Travel•Fashion•Sports•Money•Tech
Thursday February 16th 2012

Stripping Exif Meta Data

One thing that is useful to do if you are creating images for the web is to strip out the EXIF meta data from the files before uploading them to your webserver.

Starting with the moment you press the shutter on a digital camera, additional information is added to every image file. This information includes camera make and model, ISO, Aperture, date, time, the list goes on and on. As the pictures are processed, more information is added. By the time you are done there are easily a thousand different parameters that have been stored away in your image file. All this information is quite valuable and is good to keep it in the digital negative. But it adds many kilobytes of data and increases the file size by a substantial amount. When it comes to fast downloads, thin is in.  So for images only intended to be viewed on a web page it is best to strip out the EXIF meta data.

The program to do the job is called EXIFTool by Phil Harvey. EXIFTool lets you read, write and edit EXIF data. The program provides a unix command line interface to the Image:EXIFTool Perl Package. In other words you execute it from the unix command shell. This works under Macintosh and unix because they already have Perl. Windows users have a separate executable that doesn’t require Perl.

Now you are probably thinking, “What? A command line interface? Did we go back to this 1985?”

Well I can tell you that a command line interface is faster and easier than any GUI, once you figure out which command line options you need. And best of all you can automate it with a shell program. So after installing ExifTool under Mac OS X, open up a Terminal window and type exiftool to get all the options and example commands. The specific commands I used were:

%exiftool <-- help
%exiftool -a -u -g1 *.jpg <-- to read all the meta data
%exiftool -overwrite_original -all= *.jpg <-- to strip all the meta data

I also wrote a bash script to do many directories at one time. I created a file called stripall.sh using the text editor vi and put it in my ~/bin directory so I could execute from anywhere.

#!/bin/bash
##############
# Author: Your name here
# Date: 15 Feb 2009
##############
for i in $( ls); do
echo directory: $i
cd $i
ls
exiftool -all= *.jpg
rm *_original
cd ..
done

Then I cd’d to the directory above all the image directories and ran the script. All the jpegs were stripped of metadata in no time flat.

Here is the website where you can find out more information about EXIFTool and download it
EXIFTool by Phil Harvey

Let’s have a big round of applause for Phil Harvey. Way to go Phil!

More from category

Unix: How to Automate Thumbnails
Unix: How to Automate Thumbnails

Use a shell script to automate the creation and uploading of thumbnails. [Read More]

Wordpress: How to Disable Post Revisions
Wordpress: How to Disable Post Revisions

By disabling post revisions in Wordpress, it reduced the database size and allowed the wordpress MySQL database backups [Read More]

Wordpress: How to Target Ads for Different Categories
Wordpress: How to Target Ads for Different Categories

Display different ads in each categories in your Wordpress blog. [Read More]

LBB 2010 Annual Report to Shareholders
LBB 2010 Annual Report to Shareholders

2010 Web Server Report for Laguna Beach Bikini [Read More]

LBB Webserver Status Bulletin

LBB was offline due to corrupted mySQL database. The tables were repaired and the blog is back online [Read More]

Advertisement

LBB Stats