How to auto-rotate images based on EXIF information

Image viewers on the computer, in smartphones or cameras can today read the orientation information in the EXIF data of an image and auto-rotate an image when displaying it to you. However, you might want some images to be actually stored in the orientation specified in their EXIF data. For example, this helps to render correctly in old or simpler image viewers that ignore the EXIF orientation information. EXIFTran is a tool that can help you achieve this.

  • Installing it is easy:
$ sudo apt install exiftran
  • To do in-place auto-rotate of images based on their EXIF orientation:
$ exiftran -a -i *.JPEG

Tried with: EXIFTran 2.10 and Ubuntu 16.04

How to add name and copyright to EXIF

EXIFTool can be used to easily add your name and copyright to the EXIF metadata in your photos:

$ exiftool -artist="Another Joe" -copyright="(c) 2015 Another Joe" foo.jpg

Tried with: EXIFTool 9.74 and Ubuntu 14.04

Android app to view EXIF information

I was looking for an Android app to view the EXIF information of photos taken on my Moto G smartphone. I tried the following apps:

Exif Viewer was the best among the lot. The GUI is clean and the information is displayed nicely below a small preview of the photo. The one nagging problem I have with this app is that it displayed shutter speed as a fraction of 10000, which is simply meaningless to me.

Jpeg Exif Viewer, Simple Exif Viewer and EXIF Tag Viewer have ugly black GUI. They do not even display the image whose EXIF tags are being shown. I did not like these apps.

In the end, I did not pick any of these apps. I would have chosen Exif Viewer, if it did not have that Shutter Speed display problem. It turns out that the Motorola Camera app in the Moto G can display the most important EXIF information anyway: aperture, shutter speed and ISO. Just open any photo, click once on it to get the top menu, choose Options and then Details to view the EXIF information.

Tried with: Motorola Camera, Android 4.4.3 and Moto G

How to remove EXIF information from images

The EXIFTool program can be used remove all EXIF tags from an image file.

This tool can be installed from the libimage-exiftool-perl package:

$ sudo apt-get install libimage-exiftool-perl

To remove all EXIF tags from an image file:

$ exiftool -all= foo.jpg

The foo.jpg has been stripped of all EXIF tags. The original file is saved for backup as foo.jpg_original.

Tried with: ExifTool 8.60-2 and Ubuntu 12.04

How to find the shutter count of a Nikon D40

The shutter count is the number of photos a camera has taken. In the Nikon D40, this information is not available anywhere in the camera GUI. Instead, this information is written down in the EXIF information of the generated JPEG photo files.

To obtain the shutter count, open the most recent JPEG photo taken with the D40. Examine the EXIF information of the file, which can be done on the desktop or at the commandline. Look for the tag named Total Number of Pictures Taken in the Maker Note section. This number is your count.

How to view EXIF information on the desktop in Ubuntu

One of the easiest ways to view the EXIF information of a JPEG file is to use the default image viewer. This tool in Ubuntu is the Eye of GNOME, also simply called the GNOME Image Viewer.

To view the EXIF information, just open the image in Eye of GNOME and choose Image > Properties > Details. This shows all the EXIF tags and their values in the JPEG file.

Tried with: Eye of GNOME 3.4.2 and Ubuntu 12.04 LTS

How to view EXIF information at the commandline in Ubuntu

The exif tool can be used to list the EXIF information of JPEG files from the commandline in Ubuntu. This tool can be installed easily by using the package name exif.

To list the EXIF tags and their values in a JPEG file:

$ exif foo.jpg

Some of the information is specific to each camera manufacturer and this is stored in the Maker Note. To view the information in the maker note of a JPEG file:

$ exif --show-mnote foo.jpg

Tried with: exif 0.6.20 and Ubuntu 12.04 LTS