Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Using the Exif tool on Linux to read / write Exif Tags to your photo collection.

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,478
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 27, 2010

http://linuxbyexample.org

In today's screen cast I am going to show you how to read and write Exif tags to and from your digital photographs. Exif is an acronym for EXchangeable Image File format, which is a standard for including metadata in certain types of files, particularly JPEG image files produced by your digital camera. This metadata can contain a lot of information like the make of your camera, but it also includes details about each photograph, like the exposure, shutter speed and whether the flash fired or not.

I have two specific examples I want to show you today. First, lets say you forgot to change your cameras internal date and time before you went on holiday, all the pictures would be taken with the wrong time stamp, so I am going to demonstrate how you can quickly modify the date and time across all your photographs by entering a timezone offset. In the second example I am going to show you how to add a copyright notice to all your photographs.

We are going to use the Exif tool developed by Phil Harvey, which is a platform independent Perl library coupled with a command line utility, which will read and write Exif tags for JPEG images. There will be a link to this web site in the show notes. The web site contains simple instructions on how to install the software under Linux, and once installed you can start adding and modifying Exif tags to your image collection.

Here I have some photographs I took on a recent trip to France, which I am going to use for this demonstration. If I right click on an image and select properties, and then choose the image tab, you can see that my file manager lists some of the Exif tags available in the image, but not all of them.

From a terminal session, if I use Phil's tool and type in, exif tool with the dash common switch, and enter the filename of the JPEG I want to look at, the tool will output the most common Exif tags, including image size, shutter speed, aperture, white balance and so on. However, if I use the dash capital H switch, you will see that there is a huge amount of information stored within these Exif tags.

You can also list tags from multiple image files in one go. For example, lets say we wanted to extract all the dates and times that the photographs where taken, along with their focal length and aperture settings, we would use exif tool with the dash capital T switch, to output the results in a tabbed layout. We would then specify the tags we want to extract, and use star dot JPEG, to process all the files in the current directory.

As you can see it outputs the information to the screen. This becomes very powerful as you could pipe this output into file to be processed by an external script, to insert this information into a database.

Ok, lets now try updating or writing new information back to the tags within these files. I forgot to change my cameras date before going to France, and as France is one hour ahead of us here in the UK, I need to move all these times forward by one hour. To do this I would use the exif tool, with the dash all dates switch, appending plus equals one, for one hour, and specifying all files. As you can see it returns with the message, five image files updated. If we now re-run the listing command, we can see that all the times have been moved forward by one hour. Likewise, if we had been to a country with a timezone six hours behind us, we could use minus equals six, to move the times back six hours.

To add a copyright Exif tag to all your images, you would enter dash Copyright equals, followed by your copyright message enclosed in speech marks. To verify that the tags have in fact been written to your images, you can re-run the command with no settings after the dash Copyright.

It's worth pointing out that if you do write any changes back to your image files, the tool makes a backup copy of the original files first, which is a really nice feature.

The Exif tool is a really powerful piece of software, and I would recommend checking out the web site, as there are many examples, including how to add geo tagging information to your photographs.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Top Comments

  • Are you a Robot ?

  • there is a GUI

    

see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • u r right, it's a really powerful tool, but there's no gui, no plan to develop a gui for edit exif data, nor a similar project under linux. All i found are a couple of sugestions about installing wine and some windows software to do it with a gui.

    Is it so hard to develop a gui with all this power under the command line?

  • i got here by typing "i forgot what i was going to type"

  • Very cool!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more