How-To: ExifTool (Phil Harvey's Command Line Tool - and its Derivates)

ExifTool has been mentioned on and off in this forum and it might be an idea to concentrate a few tips and tricks here. Please keep this thread focused and lean. Add hints that have helped you and that others might profit from.

ExifTool homepages: https://www.exiftool.org and http://exiftool.sourceforge.net

MacOS

  • quick action, applicable to a folder with image files. Writes tags to text files. DETAILS
3 Likes

Here is what I use to remove the text “Olympus Camera” from the exif. This text is in a non-standard place and will show up in apps such as Google Photos.

The line creates an icon on the desktop. Just drag and drop your jpegs onto it and the text will be removed.

exiftool (-overwrite_original -ImageDescription=).exe

Allan

This is to extract all embadded jpg-files from the cr3-files in the current folder and copy all EXIF information into it:

got to the folder and call:

exiftool -b -JpgFromRaw -w _CR3.JPG -execute -tagsfromfile @ -srcfile %d%f_CR3.JPG -overwrite_original -common_args -ext CR3 -r .

the naming is:

xxx.CR3gets xxx_CR3.jpg

Heres an AppleScript (Mac only, of course) that uses EXIFTOOL to write/overwrite strings or tags in the ‘user comment’ field of the EXIF array.

Over the years I have used this script template to apply a lot of EXIFTOOL one-liner’s to a bunch of images selected in the Finder. It’s just simpler than using selection in the Terminal.

P

PS: I’ve zipped this just to avoid the Forum software complaining about a script upload (if it does). The script is uncompiled, however. Just text.

SetExifComments.zip (5.7 KB)

Hi,

In order to write metadata to RAW files directly I now use some scripts on Mac.
I do put an icon on my Desktop and drag and drop files onto this icon to execute it.

A simple example:
I want to set the name of my cat and some additional keywords on some pictures.
I select one or more picture in my DAM and drag them on the script’s icon I wish to execute.
The second script you see will extract the informations for a double check with Exiftool (Testing purpose).

I do create a script for all the common tasks I do.

Add metadata:
exiftool -overwrite_original -sep "," -xmp-IptcExt:PersonInImage='Merlin' -xmp-dc:Subject='mau égyptien,egyptian mau,chat,cat'

Check metadata:
exiftool -s -g -xmp-IptcExt:all -xmp-dc:all -xmp-expressionmedia:all

No more typing: Prepare the script, drag & drop.
Enjoy all the organised RAW in the assets manager of your choice without worrying about a proprietary database or forgetting to move .xmp along.
And since you do it your own way you can follow the recommandations that best suits you.

Did you know you could just use…

exiftool -overwrite_original -personInImage='Merlin' -subject='mau égyptien,egyptian mau,chat,cat'  "$f"

No need for the -sep ","argument and a lot of tags do not need the full namespace.

Hi Joanna,
Thank you.

Well I know a bit… but could not manage to find the information.
Maybe it is my understanding in English that is not good enough.
From the documentation:

XMP iptcExt Tags
This table contains tags defined by the IPTC Extension schema version 1.6. The actual namespace prefix is “Iptc4xmpExt”, but ExifTool shortens this for the family 1 group name.

Does this part in bold explicitly says “you can access these Tags Name directly, no need for the full namespace” ? (This text appears only 3 times in the pdf)

Well, if I do not set this argument, the keywords are just one:
maus1
Whereas with the argument I get the keywords correctly:
maus2

Hey, I’m English and it’s not easy for me to decipher ExifTools documentation - and I’ve been working with it for a number of years now :exploding_head:

Its not what it explicitly says but it is what it implicitly means :roll_eyes: :wink:

The documentation states that the default, if -sep is not specified, is assumed to be “,”

I just set a file using Terminal…

exiftool -subject='mau égyptien,egyptian mau,chat,cat' _JNA0004.NEF

… and in my app I got…

Capture d’écran 2022-02-20 à 12.05.09

It would appear that NeoFinder is misinterpreting the subject tag.

If I use the -sep argument, ExifTool reads back the subject as…

[XMP] Subject : mau égyptien, egyptian mau, chat, cat

If I don’t include it, ExifTool reads back the subject as…

[XMP] Subject : mau égyptien,egyptian mau,chat,cat

But my app and PL5 interpret both versions correctly.

On further investigation, it would appear that, because you have chosen to put comma-separated keywords within quotes, in order to simplify the command, the subject is being written as one single “keyword” including the commas unless you add the -sep argument.

mau égyptien,egyptian mau,chat,cat

Now, subject is a list or array tag, but both my app and PL5 are being “smart” and interpreting that “single word” as a list.

It would appear that you were right in using the -sep argument but only because some apps are not as smart as others, or maybe they are too smart :roll_eyes:

When my app writes keywords, it uses…

exiftool -overwrite_original_in_place -quiet -subject='cat' -subject='chat' -subject='egyptian mau' -subject='mau égyptien'

… which avoids the need for the -sep argument and ensures that the subject tag is read back as a true list.

It would seem, to quote an English expression, “you pay your money and you take your choice” :wink:

I guess it’s half a compliment, thanks :rofl:

Thanks, you pointed me to the right transcript.

I will double check this.

I have the feeling Exiftool writes two different things, but “smart apps” just ignore that difference, right ?

That is exactly what I wanted to avoid… too much repetition for my little brain :crazy_face:

I don’t know how much into programming you are but, instead of writing a batch file, how about looking at creating an Apple Script? These can include input dialogs, so you can prompt the user for keywords and get the script to add one argument for each.

Unfortunately, Apple Script is not that easy to understand. I certainly struggle with it, but that could be due to having programmed Mac and iOS apps in Objectivists-C and Swift for about 12 years now.

Well I know the basics. It’s always complicated to start a new language: finding the right tool, the right documentation… then the try & troubleshooting starts :sweat_smile:

I had a look at this from the macOS section on Exiftool’s homepage, a good start.

Download three droplets to extract information [exiftool must be installed] (thanks to Rob Lewis)

On the other end I really want to work with drag and drop for the most common tasks.
I have enough ideas to make keyboarding a fun and versatile thing (on macOS)… I only need an expert in GUI to make my dreams come through :unicorn:
In the meanwhile I will do what I need with scripts yes :+1:t4:

Just in case, for a specific purpose, but it may help in a more generic way
English EXIF modification - TuTo DxO
Français Modification des EXIF - TuTo DxO
Feedback welcome

1 Like