News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Adding tags to workspace

Started by ScannerBoy, July 26, 2021, 12:30:10 PM

Previous topic - Next topic

ScannerBoy

While playing around with the latest ExiftoolGUI and trying to add new tags to the workspace manager, I realized the the Flash video produced by Bogdan assumes that an image file is selected, otherwise his procedure for finding the tag to add, fails.
At the same time, though, it is important to be aware of the risk of possibly modifying the selected file.

From the video and looking at the configuration file, it seems we need to find the both the tag name & family?
His example config files always show a prefix to the tag name, such as:
exif:Artist:....
xmp-dc:Subject:.....
xmp-iptcExt:.....
My question: is there a way to easily extract the necessary information from Exiftool, without this risk of unintentionally modifying an image file or ensuring one has selected a throw-away test image?

Phil Harvey

I don't know about the GUI, but with the command line it should be easy to tell the difference between a command that writes to a file and one that doesn't.  But even if you mistakenly write to a file, the "_original" backup should be created unless you have disabled that feature via the GUI.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ScannerBoy

I'm not really concerned about telling the difference, but even on a plain command line (going by my current understanding) I would need a file name for any command such as Bogdan uses in his example video.

He does it in ExiftoolGUI, but as I understand things, it would be equivalent to a command line such as
exiftool -LocationShownProvinceState=Test "X:\path to some file.jpg"
By some magic, he ends up with an entry in his INI file, such as:

Province/State=-XMP-iptcExt:LocationShownProvinceState^

My question is really how one might get the prefix "XMP-iptcExt", knowing only the tag name LocationShownProvinceState, without needing to consider writing to any sort of test image file

StarGeek

I would suggest just using XMP, e.g. XMP:LocationShownProvinceState, instead of trying to figure out the exact family the tag belongs to.  The fact that the example config just shows EXIF for artist instead of IFD0 indicates that is all you'll need.

You can check the various Tag Names sub-pages to figure out the exact group if you want, but unless you're trying to write a tag that's marked as "Avoid", it's just easier to keep the group name simple.
* 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).

ScannerBoy

My main concern centers on avoiding the creation/introduction of 'duplicate' tags and finding a way to be concise enough, but also flexible enough when specifying a tag to be added.

Aside from Bogdan's comments on "where" in the metadata 'world'  to add tags, there is little information I have found on this topic.

As for adding tags directly to the ExiftoolGUI app's workspace, I suppose, one would have to stick with the expected format.

Even reviewing Bogdan's video tutorial is difficult, because the flash player has been discontinued and one has to resort to the still available 'debug' version of the player. Still, it does not explain the 'magic' behind the tag's prefix appearing in the workspace data.

One article recommends editing the config file directly http://carlibrary.org/ExifTool.htm#ExifToolGUI, but for that, I would expect that I would need the proper prefix.



StarGeek

Quote from: ScannerBoy on July 27, 2021, 11:23:39 AM
My main concern centers on avoiding the creation/introduction of 'duplicate' tags and finding a way to be concise enough, but also flexible enough when specifying a tag to be added.

Exiftool won't duplicate a tag in the same group and will write to the most commonly used tag with that name.  Using XMP:Rating as an example.  Rating exists as XMP-acdsee:Rating, XMP-dex:Rating, XMP-iptcExt:Rating, XMP-prism:Rating, and XMP-xmp:Rating.  But all of these except for XMP-iptcExt:Rating and XMP-xmp:Rating are marked to avoid writing to unless you explicitly name them.  And between those two, XMP-iptcExt:Rating is a structured tag and XMP-xmp:Rating is a real number tag, meaning you can't mix them up.  The first won't accept data that isn't structured and the second won't accept data that is structured.  So writing XMP:Rating will only get you one or the other, depending upon the data you write.

When writing, except in the case of MWG tags, exiftool will only create new tags in the preferred location (EXIF, IPTC, then XMP) and update any existing tags with the same name.  Using Headline as an example, writing to that tag will create the IPTC:Headline tag.  If XMP:Headline doesn't exist, it will not be created.  If it does exist, it will be updated.  It won't be created unless you explicity write to XMP:Headline (or XMP-photoshop:Headline).

The MWG tags are the exception.  They will write data to multiple corresponding tags at once following the MWG guidelines.  You can't accidentally write to these, they must be explicitly named.   See the above link for details. 

QuoteAside from Bogdan's comments on "where" in the metadata 'world'  to add tags, there is little information I have found on this topic.

The Tag Names pages have all the where info.

QuoteAs for adding tags directly to the ExiftoolGUI app's workspace, I suppose, one would have to stick with the expected format.

Taking a look at the ini file, all it does is give what exiftool needs to write that tag.  Most of the options there are just the general group anyway.  For example
Country=-xmp:LocationShownCountryName
Province=-xmp:LocationShownProvinceState
City=-xmp:LocationShownCity
Location=-xmp:LocationShownSublocation

Those are all set to just XMP, not specific XMP groups.  So it looks like you can be as general or specific as you want, as the GUI is just passing what's written there onto exiftool.
* 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).

ScannerBoy

I'll certainly have to look into the MWG comments some more, but I appreciate your comments.
They will get me on my way - at least for a good start

ScannerBoy

After getting sidetracked into cleaning up some rough edges in my app, I ended up getting back to try and write data to a test image using ExiftoolGUI (ETG).
It looked easy at the start, following Bogdan's recommendation for adding new tags, but I soon found out that I need more information on tag types and what format even XMP 'string' tags expect.
Bogdan's video tutorial assumes (silently) that we are adding a plain string value. But testing with a random sample of existing tags in the workspace, I soon found out that Exiftool (ET)will not accepts any old string for some tags, where it expects a type other than 'string'

This makes perfect sense and if I were to run ET from the command line, I would most certainly be expected to respect this requirement and investigate what sort of input ET requires to make it acceptable.
But trying to sort of emulate ETG's way of helping the user with adding the data in an acceptable format (via either suffixes or other, more adaptable/expandable ways) and possibly verifying this assumption prior to submitting it to ET, I am looking to see if ET can help directly.

Most of us are not familiar enough with the metadata 'specs' etc, and even though I have perused the Exiftool pages many times in the past, not all needed information always registers or stays for long enough to be handy when I need it ;-)

ETG indicates some of these requirements for data type or format with the trailing 'suffixes' such as ± and # etc. but the documented suffixes do not cover all possibilities, and I am wondering if there is a way to get ET to tell me via some command line arguments, the format of the data it will accept for a given tag name?
Some of the additional 'options' for these suffixes that come to mind immediately would be boolean, rational and ints of the various sizes and signed/unsigned varieties.
Looking through the data in the output from -listx is not only cumbersome, because I would either have to keep a current version (~14MB) around and scan it, but I have not even yet come to terms with what and how I would find the needed data for specific tags.

I have read through the discussion on the forum by Curtis, https://exiftool.org/forum/index.php?topic=5184.0  but it did not help me, because it seems it deals mainly with existing tags in an image.
My need is mainly for adding tags which do/may not yet exist within an image I am trying to add metadata to.

Right now, the only option I see is to send some data to ET and analyze the error messages that are returned. They usually do give a hint about what ET expected, but it is rather tedious and a bit hit-and-miss :-)
If there is a 'proper' way, I'd prefer to use it.

Phil Harvey

There is no way to tell beforehand what ExifTool will accept for a given tag.  I don't even see how this information could be conveyed because of the large number of possibilities for various tags.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ScannerBoy

Thank you, Phil, for the confirmation of my conclusions.
I'll see what the feedback from ET tells me and how I might be able to use that to use as a hint for correcting the input.