📜 ⬆️ ⬇️

ExifTool - Swiss Photo Meta Knife

To be called a lover of the command line will be somehow too much for me, rather, I became them voluntarily-forcibly, since after upgrading OS X 10.7 to 10.8, the program stopped working, which had previously done quite good geotagging on captured photos. Here we must make a digression: writing this note inspired me more or less to “neighboring” material called “ How to save money on a camera with GPS ”. In my case, there is a somewhat less perverted approach to obtaining the coordinates of the places visited, namely, recording the track with a GPS navigator, the rest is done using ExifTool .

Perhaps you can omit the receipt of a digestible track format, since this is hardly comparable to the topic of the note, but putting geotagging is one of the tasks that ExifTool wonderfully performs.

So, let's say that you have a set of pictures, a GPS track, ExifTool and the camera clock and GPS devices were synchronized (or you know the time difference). In this case, the following command will conveniently perform all actions on the * .tif files in the current directory (folder):
exiftool -geotag ~/Documents/Travel/.../some_track.gpx *.tif 

NB: I use the “exiftool” post because in my case (OS X) so it will be called relatively correctly, for Windows it would be desirable to add an extension (with respect, KO).
')
And, by the way, it will create twice as many files, leaving next to each file the original * .tif_original. This is quite convenient, while you are just experimenting in order not to overwrite existing material and not to burden yourself with additional backups. If you want to avoid such an action, it suffices to use the -overwrite_original option.

And if the camera clock and gps receiver are out of sync? For example, last year I successfully forgot to change summer time to winter time and half a year I had something a little bit wrong ... The option -geosync allows you to set this time difference.
 exiftool -geosync=+1:00:00 -geotag ~/Documents/Travel/.../some_track.gpx *.tif 

Conveniently? In my opinion, relatively convenient. Personally, I poke the mouse in search of a track file often took more time than immediately register the path to it.

There is a need for the opposite: removal of geotagging. This is also elementary:
 exiftool -xmp:geotag= *.tiff 

But let's look at other aspects of using ExifTool.

Copying exif tags

I use the RAW RPP converter, which has an option to enable or disable the copying of EXIF ​​tags. Sometimes it’s really convenient, but sometimes it’s very much too much. Zazevavshis once, I noticed the missing information already after all * .tiff were generated and processed. But it turned out that this option is not a problem. The solution is elementary as for a single file:
 exiftool -TagsFromFile a.cr2 a.jpg 

So for several files in the folder (it is assumed that the originals and derivatives are “next”):
 exiftool -tagsfromfile %d%f.CRW -r -ext JPG dir 


Dump in a more or less chronological pile of photos from different cameras

Renaming is carried out only on the basis of the date from EXIF, the name of the original file is deleted:
 exiftool -d %Y%m%d-%H%M%S.%%e "-filename<CreateDate" *.cr2 

And without deleting the original name:
 exiftool -d %Y%m%d-%H%M%S%%-c-%%f.%%e "-filename<CreateDate" *.cr2 

NB: it is desirable that the camera clock be pre-synchronized (with respect, KO).

You can enter your titles and emails in the metadata.

You want to be able to find you later?
 exiftool -Artist='Ivan Petrov' -Copyright='© Ivan Petrov, all rights reserved' -By-line='Ivan Petrov' -Credit='Petrov Studio' -Contact='ivan@petrov.com' '-xmp-xmprights:marked=1' -overwrite_original *.cr2 


Extract certain data (for example, focal length)

During one discussion, I needed to answer the question of what are the most popular (mine) focal lengths. But it is necessary to take the source data from somewhere. Well, you can upload information to a text file, for example, in the format:
 exiftool -r -T -filename -focallength -ext CR2 FOLDER_NAME > FILE_NAME.txt 

Further analysis is easily performed in your favorite table processor (although my friend, lazy, pulled it all into the SQL database, it was faster for him).

Restore file creation date

During the manipulations, ExifTool will change the date the file was created (which, in principle, is logical, since the files are overwritten). It is easy to restore the date of creation of the original:
 exiftool "-filemodifydate<datetimeoriginal" DIR 


Extract embedded RAW JPEGs

Sometimes it is useful. However, it is elementary:
 exiftool -b -PreviewImage -w _preview.jpg -ext RAW_EXTENSION -r FOLDER 


Add to EXIF ​​data about old optics

Having available the arsenal of old optics and various adapters for the Sony Nex, I also have a desire to know what lens I shot. This is also quite possible:
 exiftool -LensModel="Meyer Optik Görlitz Oreston 50mm F1.8" ‑"MaxApertureValue"=1.8 ‑FocalLengthIn35mmFormat="75" ‑FocalLength="50" ‑LensType="M42 via adapter" FILENAME/MASK 

On the well-known forum of amateur MF optics, a more elegant option is proposed, which requires the creation of a file description for each lens, in appearance:
 -n -XMP:Lens=Carl Zeiss Jena Tessar 50mm f/3.5 (EXA) -XMP:SerialNumber=3692001 -EXIF:MaxApertureValue=3.5 -EXIF:FocalLength=50 -EXIF:FocalLengthIn35mmFormat=50 -EXIF:FNumber=5.6 

After which its application will be somewhat more trivial:
 exiftool -@ czjtessar50exa.txt H:\RAW\2012\20120218.Family.NEX\ 

NB: the last line in the description file is optional, because it defines the recording of the “working value” of the diaphragm, and, firstly, it can be different, and secondly, not everyone is really interested. After all, then it is necessary not only to remember it, but also to put it down separately for all photos ...

I hope someone will find this information interesting and / or useful, although it is, by and large, excerpts from the ExifTool documentation. However, it is not always possible to read all the documentation, because the “ready-made recipe” may be useful. At least I think so. Good luck!

UPD1. In the comments ( here ) advise an alternative for some operations - I have not yet looked, but all of a sudden.
UPD2. And also - a sensible reminder of the existence of a Windows GUI for ExifTool.

Source: https://habr.com/ru/post/232267/


All Articles