Area utenti

  Soluzioni Linux per il vostro business
 

How to edit exif data of a photograph in GNU/Linux

Ok, so you're a photographer and like to take photographs. If you put them in flickr, you will sometimes need to edit their EXIF data, i.e. the strings in the photo which tells with which camera you shot it, at what shutter speed and so on.
Moreover, if you sell photographs in a microstock site such as ShutterStock or Fotolia, you will need to edit the data and insert information about description and keywords. When you upload the photo, then, the microstock site usually reads the exif data and populates automatically the upload form.

With Windows you can view a subset of the exif data with the "properties" entry of the context menu; in GNU/Linux you can use gqview, for example. Editing those data is quite more complex, but in GNU/Linux you can do it from the command-line, allowing very powerful scripts and more time to shoot :)

What does the trick is exiftool, a Perl script by Phil Harvey. This script can read and write meta information not only in images, but also in audio and video, and recognizes EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3 meta information as well as the maker notes of many digital cameras including Canon, Casio, FujiFilm, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo, Sigma/Foveon and Sony. Wow! And the system requirements are only Perl 5.004 or higher.

Ok, so how do we use it? You can print exif data of a photograph just like this:

exiftool -list image.jpg | less

Be sure to pipe it into less, because it's A LOT of data :)

To add a "keywords" entry with some values in it, just type:

exiftool -keywords="key1,key2,key3" image.jpg

Using "+" instead of "=" allows to add values to the list, and "-" deletes them. ">=" sets the value of the tag to the contents of a file given in the command line.

If you want to view only the "keywords" tag, type:

exiftool -keywords image.jpg

And what about tagging a series of photos with the same keywords?

exiftool -keywords+"key1,key2,key3" *

(yes, it works with multiple files too)

Ok, so now you can edit your keywords and description and can manage to upload many images at once on your preferred microstock site. What else? Well, with exiftool you can also geotag your photos. But this is another story... ;)


Catnic Srl