Adding spaces into tag value

Started by piotr_ch0, August 25, 2023, 09:24:44 PM

Previous topic - Next topic

piotr_ch0

Yes, I did search the FAQ for "spaces" and I searched the site and the forums for it - couldn't find a relevant answer.

I'd like to separate tag (-Author=) value words with spaces (and an underscore). Of course, when I input them the tool either doesn't run the command or just cuts the expression after the first space. I tried using quotes, either ' or " in various combos - to no avail.  And no, I don't want to replace spaces with underscores. I'm using a 'Last name  _ First name' convention for a whole workflow,  and in other places this would just mess things up. Among other reasons, due to the fact that I do account for multiple first and last names (think Latin America etc. ) - underscore allows for separating first and last names and spaces are used for separating the various last names or various first and second names.

So, what do I have to do for the tool to successfully write an 'Author=' value that includes spaces? An example would be appreciated.


StarGeek

What is the exact command you are using and its output, what OS, and what command line?

Using double quotes works correctly here on Windows CMD.  On Linux/Mac, either single or double quotes should work.  No idea about Windows Powershell because it doesn't use quotes the way other command lines do

C:\>exiftool -G1 -a -s -Author="Indiana Jones Jr." y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Author y:\!temp\Test4.jpg
[XMP-pdf]      Author                          : Indiana Jones Jr.

Note that using Author by itself is going to write to a PDF tag.  Depending upon what you're trying to do, Author probably isn't the tag you want to write to.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

piotr_ch0

The command, with its value would be:
-Author="LastName _ FirstName". So you're looking at two spaces and an underscore within the command value.

I'm certain that Author is the right command since when it does succeed (ie. when I forego spaces) it updates the file's metadata that I want to change. I see the change reflected in File properties.

I'm running Windows. I'm not updating a PDF's metadata - I'm updating a RAW photos EXIF.

About the command line - here's where things get complicated, and I suppose, secondary issues irrelevant of ExifTool per se may arise.
I'm not interacting with ExifTool directly. It can't accomplish the workflow I have, ie. working on files dispersed across tens of folders without having to navigate through said folders.
Instead I'm running LightRoom classic with a plug-in called LensTagger by Dirk Essl (https://www.lenstagger.com/. It comes with a packaged copy of ExifTool and offers a tailor-made form that user fills with values specific for photography (lenses, aperture, film etc. ). It then translates this data into commands and displays them in a field. This field can be edited manually, allowing user to add commands not featured in the fields. That's where I input the said 'Author=' command. It doesn't provide full feedback like ExifTool's own UI / command line. It only says if the command succeeded or not.
So, when I use spaces - it returns: 'Error: 1 - Failed to run command'. When I don't use spaces but include quotes in this particular command - same (fails). When I don't use spaces and don't use quotes - it succeeds, returning: "Command successful!" And I see the changes reflected in File properties of Windows explorer.

The plug-in author doesn't provide documentation on the project- or his own website. He doesn't mention the mechanics of communication with ExifTool nor what programming language he used. Neither him or the project has a GitHub profile / repo (respectively). Confusingly, there's another project with the same name on GitHub, written by a different guy. That uses Python to interface with ExifTool, and seems to be not a plug-in but an (unreleased) Linux/Mac app. Anywho, that leads me to think that the not only ExifTool itself may be a bottleneck, but the LensTagger and its own programming lanugage (whatever it may be) with its syntax limitations may be another one.

Now, I did try to just run the version of ExifTool that came with the plug-in. But when I open the ExifTool.exe within the plug-in folder I'm only presented with a few instructions and a non-working command line window. The window is active, the cursor blinks, I click on keys, but nothing gets written. The instructions says to drop a file onto that window. I do, and then it crashes. The ExifTool's own window.
Even if I downloaded ExifTool separately, from official distribution and got it to work (isolating the issue), it doesn't fix my workflow.

The standard in the photo industry is to use a library manager, instead of operating directly on folders. This way I can preview and select thousand of photos (assets) across tens if not hundreds of folders easily, use filters across multiple folders at once, and select a mix of files across various folders. Using this plug-in I have been able to successfully deploy ExifTool to write changes to RAW photos' lens name, aperture, focal length, focal length in 35mm format fields, thousands of times over the last 1.5 year. It does work.

Now, if I can't get LensTagger to work, I'm screwed. Even if ExifTool works, I still would have to delve into hundreds of folders manually, with File explorer's sluggish thumbnail loading, feed the directories one-by-one into ExifTool and first filter files for each folder separately.

See screenshot below.

Screenshot 2023-08-26 130149.png 

StarGeek

Quote from: piotr_ch0 on August 26, 2023, 07:10:14 AMI'm not interacting with ExifTool directly. It can't accomplish the workflow I have, ie. working on files dispersed across tens of folders without having to navigate through said folders.
Instead I'm running LightRoom classic with a plug-in called LensTagger by Dirk Essl

This is not an exiftool question, it's a LensTagger question.  Additionally, it's a FAQ #3 question.

Luckily, I have LR 4.0, which I had to reinstall as I haven't used it since the last time I re-installed Windows.  And it is able to use LensTagger, so I can add that.

First, FAQ #3.  When you use just Author, as I show above, you are updating the XMP-pdf:Author, which is a PDF tag.  If you run the command in FAQ #3 on a file that already has the correct data set, it will show you the tags and their values that are in the file so you can figure out what is the tag you actually want to use.

The names used under the Windows Properties->Details are not tag names.  They are Windows properties.  Windows read a variety of different tags to full these properties.  In the case of the Windows Author property, Windows will read four tags
EXIF:Artist
EXIF:XPAuthor
IPTC:By-line
XMP-dc:Creator

See this post for a translation table of what tags correspond to each Windows property.

IPTC tags are outdated and the XP* tags are Windows only tags, so I suggest you use the XMP:Creator tag, possibly the EXIF:Artist if you like.  My copy of LR lists Artist and Creator in the metadata, corresponding the the tags of the same name (it doesn't always).

As a case of doesn't always, checking with Adobe Bridge, it lists a property of "Author" under IPTC IIM but that is filled from XMP:Creator regardless of the values that are in the IPTC block.

Hmmm... LensTagger is writing to IPTC:Keywords with no way to change it to something else and save.  It should be writing to XMP:Subject.

With LensTagger, I can duplicate your experience when you add new options to the end of the command.  But looking at the actual command it's going to run, which is this when I don't select anyting to update
"C:\Users\Bryan\AppData\Roaming\Adobe\Lightroom\Modules\LensTagger-1.9.2.lrplugin\win\exiftool.exe  -m -overwrite_original_in_place -P "-UserComment<LensTaggerVer:1.7.6" -Keywords+="LensTagger" "D:\!Adobe_Lightroom_Catalog\TestPictures\Test4.jpg"" -v0 > C:\Windows\Temp\excmd.txt
I notice that everything before the -v0 is additionally quoted.  This gives two quotes at the end after Test4.jpg"" and in your case, since the path to exiftool contains a space, you get two quotes at the beginning.

This indicates to me that everything between those quotes is the command that is actually run.  If you make sure your edit is between those two quotes (and not in between a two-part option), the command will run.

Example


I have no comment on the error that pops up, as that is a LensTagger issue and might be related to how old my copy of LR is.  It does not prevent LensTagger from working though.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).