If you’ve ever taken a deep look at the meta information tucked inside your photo files, you realize there is a lot more going on in a JPEG or RAW file than just pixel information. Inside the labyrinth of code are tucked away tiny snippets of information that reveal every detail about how you took the photograph. Everything from the orientation of your camera (did you ever wonder why you don’t have to rotate images anymore) to the temperature of the your camera is recorded for posterity. One new innovation among camera makers and photographers is to embed GPS information within the photo file. Although GPS information is exceedingly handy for the photographer, it can also raise privacy concerns when your photos are published to the web.
All self respecting photo editing softwares can mine meta data for you and present it for reference and modification. Each software, however, has its own way of presenting the meta data and limitations on how you can modify it. It can also be be confounding to determine whether data has been deleted or just hidden and whether the modifications on RAW files are passed onto JPEG export files. This article will illustrate how to use a freeware tool known as ExifTool to gain total control over the contents of your photo files. Exiftool is known for its ability to parse a photo file and extract every last hidden drop of meta data for reference or editing.
Unfortunately, what ExifTool boasts in power it lacks in user-friendliness. To that end, we’ll couple its demonstration with another great Mac tool – Automator. Automator is a Mac utility used to build your own applications and is one of the most underused utilities on the Mac. For this exercise, we will focus on programming two utilities, a meta data viewer and a GPS data delete utility. Once you have these utilities, you will be able to control the contents of your files directly. You will also be able to delete/modify any sensitive information (such as embedded GPS data) before uploading to the web. Unsure whether Aperture or Lightroom made the meta modifications you wanted? These utilities will help you check.
Creating a Meta Data Mining Application
1. Download and install ExifTool
- Download the Mac OSX installation package from http://www.sno.phy.queensu.ca/~phil/exiftool/ (the download file should be called something like ExifTool-xxx.dmg).
- Installation is as easy as opening the disk image and double clicking. This will install the exiftool command line tool into your /usr/bin directory. The exiftool command can now be invoked from any command line prompt. Command line junkies can feel free to explore the power of exiftool at this point. For the rest of us, we’re going to create a simpler user interface for the tool via Automator.
2. Create Automator Actions for ease of use
- Open Automator from your application directory. You should see a quick start window asking you to choose a template. Choose the workflow template.
- At this point you should see a panel with available actions (such as “Activate Fonts”). The workflow is built by dragging various actions to the right to design a workflow.
- For this workflow, we’ll need four actions: Ask for Confirmation, Ask for Finder Items, Run Shell Script, and Show Growl Notification. If Growl is not installed on your Mac, you will not see its notification action so just leave it out. Drag each of these actions to the workflow panel on the right.
- WIth all the actions in place, we can begin customizing them. Within the Ask for Confirmation action, type the following text:
This application will extract all meta data from your photo file and write it to a text file called *_meta.txt
- Within the Ask for Finder Items Action, choose the Start At folder which you want to be your default folder for selecting photos. Under Type, select Files and Folders. Lastly, check the box for Allow Multiple Selections.
- Within the Run Shell Script Action, simply paste in the script below. Ensure all characters and formatting are preserved in the pasted text. Then choose to Pass input as arguments.for f in "$@"doexiftool -a -u -n -g1 -w! %d%f_meta.txt "$f"done
- Within the Show Growl Notification Action, Type a Title such as “Complete!”. Under Description type “Text File Written”.
The finished workflow should look something like this:
- To finish, select File -> Save As and give your application a name such as Readmeta. Then choose a save location (such as your Desktop). Under File Format, choose Application. Clicking Save should create an application in the location you chose. Optionally, you can save a second version of your application in the Workflow file format so you can open and modify the contents later.
- To test the application, find the newly created application and double click it. This should bring up the confirmation prompt you programmed above. Click OK and you should see a finder window. Select any photo file (or multiple photo files) and click Choose. Note that if you highlight a folder and click choose then all the application will write text files for every photo in that folder. Once the selection is complete and assuming you programmed the Growl Action, you should see the Growl notification pop up saying “Complete!” A text file should be written to the same folder containing the photo file. Open the text file to see all the details of your photo.
- Congratulations. You’re new application is complete. Use it to mine the details of any photo you wish. Our next project will be create an application to modify meta information – specifically to delete all GPS information from a given photo file.
Creating a GPS Data Delete Application
This application will be very similar to the one above with only slight changes to the shell script. Make another Automator workflow based on the screenshot below and save it as something like “DeleteGPS.app”.
To test this application, first run the ReadMeta.app application on a file which you know has embedded GPS data to see how the GPS information is encoded. Then run DeleteGPS.app to delete the GPS data. Finally, run ReadMeta.app again to verify that the GPS data was surgically removed.
These exercises should give you an overview of how ExifTool and Automator Actions can enhance your photo workflow. Once you understand the fundamentals of each of these tools and how they can work together, you should be able to tweak the scripts for many other different uses.
Special thanks to Phil Harvey, the creator of ExifTool, for creating and maintaing such a great freeware tool.
Notes on the shell scripts:
- ExifTool,by default, creates backup originals of any file that it modifies. I have chosen to delete those backup files in the DeleteGPS shell script to avoid creating too many confusing versions of files. If you like the idea of a backup file, simply remove the second exiftool command in the script. To restore any file from the backup, just type exiftool -restore_backup [filename to restore] at the command line.
Get More Camera Technica Greatness: