partial support of metadata copy from JPG file (or other) to JXL file ?

Started by mkornelix, November 20, 2024, 04:36:28 AM

Previous topic - Next topic

mkornelix

This command works OK for JPG/PNG/TIF/... but only partially for JXL

$: exiftool -v -tagsfromfile BMW-21.jpg -all BMW-21.jxl -overwrite_original

Setting new values from BMW-21.jpg
======== BMW-21.jxl
Rewriting BMW-21.jxl...
  Editing tags in: Exif ExifIFD File GPS IFD0 IPTC ItemList JFIF JP2 Keys MIE-Doc MIE-GPS MIE-Geo MIE-Image MakerNotes PDF PNG PhotoMechanic Photoshop PostScript UserData XMP xml 
  Rewriting EXIF
  + [TIFF directory]
  Rewriting IFD0
  Rewriting GPS
  Rewriting XMP
    1 image files updated

title, description, rating, country, GPS data are copied.
city, keywords are not copied.

Is this permanent or will it be fixed?
Thanks in advance.


StarGeek

Are your keywords in IPTC:Keywords or in XMP:Subject?

Keywords can't be copied because JXL doesn't support the old IPTC IIM standard. You have to copy them from IPTC:Keywords into XMP:Subject. This can be done with the iptc2xmp.args args file (see arg files on Github).

If the keywords are in XMP:Subject, they should have been copied and that is what happened in my quick test.

As for City, it seems to me that it should be copied over, as it has the same name in XMP as it does in IPTC. But looking at the -v3 (-verbose3) output, it says
Writing XMP-photoshop:City if tag exists.

If it is in XMP:City, it isn't copied and gives the same message.

Using -All:All instead of -All will copy the City tag if it is in XMP. This relates to FAQ #9, "The tag locations change when I use -tagsfromfile to copy information".

Phil is currently away, so it will be about a week before he can respond to this. But the above args file will correctly copy City from the IPTC to the XMP tag.
"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

mkornelix

Thanks for your help.

Up to now I have been able to use the same exiftool command to get/put/copy metadata for all image file types (jpg png tif webp heif jp2 ...). Apparently I will need to make exceptions for JXL files. It's a problem. The relevant app is Fotocx, an image editor and collection manager for Linux. exiftool does a great job of making the differences go away for simple operations. Should not the -keyword tag work transparently?

StarGeek

Quote from: mkornelix on November 20, 2024, 01:57:18 PMShould not the -keyword tag work transparently?

No. Tag names are not general. They apply only to tags with that name*. In the old IPTC standard, it was called Keywords. But the newer XMP standard, it is called Subject.

You should use the command in FAQ #3 to take a look at your files. All the other tags you list are XMP tags, (except the GPS ones, which are normally in EXIF, but can also appear in XMP). You may have been ending up with mixed groups in your copies, with some tags in XMP and others in IPTC.

Additional possible problems. IPTC tags are non-standard in PNG, and JP2. Exiftool and probably ImageMagick and exiv2 are about the only programs able to read them. IPTC cannot appear in WebP and HEIF files.

* There are a lot of details I'm glossing over with the statement, such as MWG (Metadata Working Group) tags, Composite tags, Extra tags, and Shortcut tags. But for most purposes, the statement is accurate.
"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

mkornelix

Your post highlights the metadata chaos an app developer must deal with. exiftool has been a great help to rationalize this chaos. Example: -keywords tag works for all file types I deal with. But not JXL. Ideally, exiftool would make -keywords (and others) work transparently for all file types, or at least the relevant ones where users would naturally use keywords or tags to classify images. I hope I am not beating a dead horse here. Ideally, if -keywords is used for a JXL file, exiftool woud convert this to -subject. Ideally, the JXL standard would have kept -keywords instead of making arbitrary changes that make life for developers more difficult.

I will have to deal with it. Thanks for your help.

mkornelix

How about a new feature to simplify tag name mismatch when copying, e.g. allowing -keywords to be written to a JXL file. Something like this:

$ exiftool -synonym:keywords,subject -tagsfromfile file.jpg file.jxl -overwrite_original

Copying from JPG to JXL would copy -keywords to -subject
Copying from JXL to JPG would copy -subject to -keywords

Also for editing, e.g. -keywords=hawaii


StarGeek

The synonym feature is unlikely to happen, as it would take a lot of bookkeeping to identify all possibilities. But Phil will have to respond for more details and he's currently AFK until next week.

Otherwise, this gets into the asterisk section of my post. You might take a look at the MWG tags page. These are tags that follow the (now defunct) Metadata Working Group standard and will write data to multiple, related tags. The scope is limited, though, as there are only thirteen tags. But it covers five of the tags you list.

Another alternative would be for you to create Shortcut tags (see the Shortcuts tags page). Shortcuts tags are a list of related tags that can be written at the same time with a single command. I use them extensively. This post gives some examples of the shortcuts I 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