lundi 26 février 2007

Write GPS data on your photos with Exiftool

Exiftool is a Windows/Mac command-line app (or a muti-plateform Perl librairy) to read and write EXIF metadatas on certain file types.

In the following I will use .jpg files from my camera and the Windows .exe version of Exiftool that I will control in a DOS shell.

Want to see some EXIF metadata in your picture ?

$ exiftool mypicture.jpg

Want to extract the precise date and time when this picture was taken ?

$ exiftool -CreateDate mypicture.jpg
( Returns something "2007:02:10 21:19:43")

Want to write your picture was on the Eastern part of Greenwich meridian ?

$ exiftool -GPSLongitudeRef="E" mypicture.jpg

Want to write the exact the longitude value ?

$ exiftool -GPSLongitude="7.422809" mypicture.jpg

Want to write your picture is in the northern latitudes ?

$ exiftool -GPSLatitudeRef="N" mypicture.jpg

and give the exact latitude value ?

$ exiftool -GPSLatitude="48.419973" mypicture.jpg

Obviously you can combine the four tags above in just one line.

You can check everything went well with another exiftool mypicture.jpg (warning: if the app. doesn't understand what to do it didn't return me any error message by default ).

More informations about the GPS tags can be found here.

With this Free Software GPL command-line version it's now easy to integrate geolacalisation capabilities in a Python script for example.

I can upload my pictures on Flickr and they will show on the Flick maps but I still need to use the geocoding bookmarklet if I want to add the geotagged tags and the google maps.

PS: -n option gives you the latitude/longitude in the decimal form when reading these tags
PS: Python also have a nice similar library but I didnt' succeed to write GPS data with it,

Aucun commentaire: