Exiftool is easy to use

Exiftool is a very easy to use, complete, command-line interface to image EXIF data. It also (and especially) works with GPS data and tiff files.

For instance, to view the filename, size and latitude of an image:
exiftool -filename -imagesize -gps:GPSLatitude IMGP0737.tif

To set the new latitude of an image:
exiftool -gps:GPSLatitude="52 deg 47' 22.5894" IMGP0737.tif

I read the Exif 2.2 spec (ya know, light reading), and realized that I was formatting the GPS info tag incorrectly. Exiftool formats the correct version to look pretty (and as above). However, the official spec states that the latitude and longitude info should be dd,mm,ss or dd,mmmm and then the North/South and East/West specified in the GPSLatitudeRef and GPSLongitudeRef as N/S, or E/W. Therefore, the correct format is:

exiftool -GPSMapDatum="WGS-84" -gps:GPSLatitude="34,57,57" -gps:GPSLatitudeRef="N" -gps:GPSLongitude="83,17,59" -gps:GPSLongitudeRef="W" -gps:GPSAltitudeRef="0" -GPSAltitude=1426 -gps:GPSMeasureMode=2 -City="RabunBald" -State="North Carolina" -Country="USA" ~/Desktop/RabunBaldSummit_NC.jpg

About this article

written on
posted in ProgrammingGeolocationLinux Back to Top

About the Author

Andrew Turner is an advocate of open standards and open data. He is actively involved in many organizations developing and supporting open standards, including OpenStreetMap, Open Geospatial Consortium, Open Web Foundation, OSGeo, and the World Wide Web Consortium. He co-founded CrisisCommons, a community of volunteers that, in coordination with government agencies and disaster response groups, build technology tools to help people in need during and after a crisis such as an earthquake, tsunami, tornado, hurricane, flood, or wildfire.