Question Exiftool TagNames Syntax

Started by ArchZu, August 14, 2023, 08:48:22 PM

Previous topic - Next topic

ArchZu

I'm creating a script that will download an image from a website, filter the image information and attach it to the file.

Does EXIF:XPKeywords or XMP-dc:subject support hierarchical levels?
-EXIF:XPKeywords="one;two;three"
-XMP-dc:subject="one, two, Three"


do XMP-xmp:Keywords and XMP-xmpMM:Subject support hierarchical levels? Did I write them correctly?
-XMP-xmp:Keywords="Site|Tag|one, Site|Tag|two, Site|Tag|Three"
-XMP-xmpMM:Subject="Site|Tag|one" -XMP-xmpMM:Subject="Site|Tag|two" -XMP-xmpMM:Subject="Site|Tag|Three"


Are there any other important XMP TagNames I'm not using that are used to assign keywords to images other than the ones above and the ones below?
[XMP-acdsee], [XMP-digiKam], [XMP-microsoft], [XMP-lr], [XMP-mediapro].
Arch Linux (KDE Plasma)

Phil Harvey

The tag name documentation gives details about which tags are "List" type.  List tags are written according to FAQ 17.  The hierarchical levels aren't handled by ExifTool -- the "|" character isn't treated specially.

- 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 ($).

ArchZu

I'm doing my script without using "-sep", it generates this monstrosity. I may be doing it the hard way maybe, because I'm new to exiftool.



I even created a program to generate the acdsee file.



the output of the first image goes in $code
exiftool -overwrite_original $code $imageFile

am I doing it wrong?
Arch Linux (KDE Plasma)

StarGeek

It looks like on several of those, you're creating a massively long single entry.  For example, XMP-dc:Subject is just a single entry unless you add the -sep option.

Quote from: ArchZu on August 14, 2023, 08:48:22 PMDoes EXIF:XPKeywords or XMP-dc:subject support hierarchical levels?

That is entirely reliant on the software that is reading the data.  Some software might and others may have options you can set for it.  For example, IMatch has several options for hierarchical  separators.  IIRC, the old Windows Live Photo Gallery used a slash as a hierarchical separator.

Quotedo XMP-xmp:Keywords and XMP-xmpMM:Subject support hierarchical levels? Did I write them correctly?

Again, entirely dependent on the software used.  Though I'm not sure there's any software that reads these.  At least, I've never found any.

QuoteAre there any other important XMP TagNames I'm not using that are used to assign keywords to images other than the ones above and the ones below?

I have to question why you feel the need to add all these other tags. Several of those are software specific and useless outside of that software.  And odds are they will already read XMP-dc:Subject, possible HierarchicalSubject as well.  You're doing a lot of extra work and introducing a lot of complexity with very little return on it and increasing the possibility of errors.

For example, XPKeywords is pretty much only read by Windows, which will read IPTC:Keywords and XMP:Subject as well.  The same goes for LastKeywordXMP/LastKeywordIPTC.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ArchZu

"XMP-xmp" and "XMP-xmpMM" was the gpt chat that spoke them to me, but I don't know if I use the / or the | as a separator, because I've never seen it either. The only ones I know are from digikam.

The initial intention was to add everything I could EXIF, IPTC, XMP, but due to GIF limitations I ignored EXIF and IPTC and chose only XMP.

So the idea became to add as many XMP TagNames as possible to be compatible with as many software as possible. As I'm writing a script to put keywords in the images, it would be a lot of work if I forgot to put a TagName that I might use in the future. So my first thought was, I'm going to add as many as I can. Maybe it's not a good idea.

The only ones I'm currently using are "XMP-dc", "XMP-digiKam" and "XMP-acdsee:Categories".

I haven't come across any errors yet, but I've also created 3 utilities to help me with this. They check the checksum of the image, take only the pixels in rgb or rgba or hexadecimal and gram a hash. so even if I move the exif data the hash does not change, but if I change the format the hexadecimal hash changes, but rgb and rgba remain the same.

I haven't run into any errors yet, but I've also created 3 utilities to help me with this. They check the hash of the image, take only the rgb, rgba or ascii pixels of the image and generate a hash. so even if I change the exif/xmp data of the image, the hashes remain identical. But if I change the image format, the hex hash that is displayed in ascii changes, but rgb and rgba remain the same, because they are checking the colors of the pixels.





I think I'll just use the ones digikam uses.
Note: I started learning about the image data less than seven days ago.
Arch Linux (KDE Plasma)

ArchZu

What I'm going to do is this now:
XMP-dc:Title=Image URL

XMP-dc:Description=HASHs

XMP-dc, XMP-digiKam, XMP-lr:hierarchicalSubject, XMP-acdsee:Categories =Keywords


suggestions for any modifications?
Arch Linux (KDE Plasma)

StarGeek

Quote from: ArchZu on August 14, 2023, 11:58:38 PM"XMP-xmp" and "XMP-xmpMM" was the gpt chat that spoke them to me,

As always with ChatGPT, verify the data elsewhere.  ChatGPT is good for a starting point, but it will happily give you false information, especially on something that is obscure like this.

QuoteThe initial intention was to add everything I could EXIF, IPTC, XMP, but due to GIF limitations I ignored EXIF and IPTC and chose only XMP.

My advice is don't bother with IPTC IIM unless your workflow needs it.  Most modern programs will read XMP.

In EXIF, don't bother with the Microsoft specific tags, XP* (XPAuthor, XPComment, XPKeywords, etc) as nearly nothing other than Windows will read them and Windows will also read the basic IPTC Photo Metadata Standard tags, making the XP* redundant.  This pretty much applies to any Microsoft specific tag unless you are using a piece of software that only reads them.

IMO, the only other things in EXIF that are worth touching are the main time stamps and the associated Time Zone and SubSecond tags, the GPS tags, and maybe the EXIF:Copyright and Artist (which corrisponds to IPTC:By-line and XMP:Creator) tags.  Everything else is set by the camera and usually doesn't need to be changed.

QuoteSo the idea became to add as many XMP TagNames as possible to be compatible with as many software as possible. As I'm writing a script to put keywords in the images, it would be a lot of work if I forgot to put a TagName that I might use in the future. So my first thought was, I'm going to add as many as I can. Maybe it's not a good idea.

The only ones I'm currently using are "XMP-dc", "XMP-digiKam" and "XMP-acdsee:Categories".

Any decent program is going to be using the basic tags in the standard above.  I know both DigiKam and ACDSee will read the XMP:Subject tag and populate their own tags based off of that, though I don't know how much hierarchy support they have.  That might be worth testing out.  If they read either a hierarchy in Subject or XMP:HierarchicalSubject, then let them populate their own tags as needed.

Also, here's my opinion on keeping tag names simple.  The DigiKam and ACDSee tags are more likely to need the full group name, though.

QuoteI haven't come across any errors yet, but I've also created 3 utilities to help me with this. They check the checksum of the image, take only the pixels in rgb or rgba or hexadecimal and gram a hash. so even if I move the exif data the hash does not change, but if I change the format the hexadecimal hash changes, but rgb and rgba remain the same.

Try
exiftool "-OriginalImageHash<ImageDataHash" "-OriginalImageHashType=MD5" /path/to/files/

ImageDataHash is a new tag (ver 12.63+) that calculates the hash for the image/video data only, ignoring the metadata.  See its listing on the Extra Tags page for more details.

By default, it uses MD5, but you can change it to SHA256 or SHA512 using the -api ImageHashType option

You could then check the files with
exiftool -if "$OriginalImageHash ne $ImageDataHash" -Filename /path/to/files/
which would list files where the hashes no longer match.

The only downside is that I doubt either DigiKam or ACDSee would read the OriginalImageHash, though you could work around that by instead writing to a tag that they support but you might be unlikely to use.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ArchZu

QuoteTry
exiftool "-OriginalImageHash<ImageDataHash" "-OriginalImageHashType=MD5" /path/to/files/

ImageDataHash is a new tag (ver 12.63+) that calculates the hash for the image/video data only, ignoring the metadata.  See its listing on the Extra Tags page for more details.

It doesn't seem to work with gif images, it doesn't generate the hash.


It's like this for now.

exiftool -ee3 -U -G3:1 -api requestall=3 -api largefilesupport ./anime-pictures.net_pictures_download_image_479508-1280x720-re:zero+kara+hajimeru+isekai+seikatsu-white+fox-ram+(re:zero)-single-looking+at+viewer-fringe.gif


exiftool -b XMP anime-pictures.net_pictures_download_image_479508-1280x720-re:zero+kara+hajimeru+isekai+seikatsu-white+fox-ram+(re:zero)-single-looking+at+viewer-fringe.gif
Arch Linux (KDE Plasma)