Error when writing Label to sidecar?

Started by lokatz, November 18, 2024, 07:19:21 AM

Previous topic - Next topic

lokatz

My application at one point uses

-tagsfromfile [RAW filename] [XMP filename] -overwrite_original
to create an XMP sidecar, in this case from a Sony .ARW image file.  The original image contains a Rating entry, which is written to XMP correctly, but no Label entry.  To my surprise, the sidecar file ExifTool created contains this line:

  <xmp:Label>=</xmp:Label>
I would have expected no Label entry, or an empty one, being created, but not one with the '=' character.  What am I overlooking?


StarGeek

How you double checked to make sure there isn't a Label tag in a different group?
exiftool -G1 -a -s -Label file.arw

Your command will not keep tag names in their original groups. See FAQ #9, "The tag locations change when I use -tagsfromfile to copy information".

If you only want to copy XMP tags to the side car file, you should use -XMP:All, though in this case, you can also use -All:All, because an XMP sidecar file can only hold XMP data.
-tagsfromfile file.arw -XMP:All file.xmp
or
-tagsfromfile file.arw -All:All file.xmp

If you want to transfer tags from other groups, such as EXIF or IPTC, you should use the appropriate ARGS file, which you can download from GitHub
-tagsfromfile file.arw -@ iptc2xmp.args -exif2xmp.args -@ -XMP:All file.xmp

If you're sure there is something else wrong, it would help if you could share the file, either by posting it here or if sending me a link through a DM.
"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

lokatz

Thanks for your response.

I am positive that the file does not contain a Label entry in any group.

For the benefit of others, I think there were two small issues in the ARGS file approach you suggested.  It should have read

-tagsfromfile file.arw -@ iptc2xmp.args -@ exif2xmp.args -XMP:All file.xmp
At least, that's what I tried and what has worked.  Unfortunately, the outcome was the same.

I will PM you with a link to the image file.

StarGeek

#3
What version of exiftool are you using? Did the XMP sidecar file exist before running exiftool? Are you using exiftool to view the XMP file or some other program?

I can't replicate the problem here. file.ARW is your file, just renamed.

C:\>exiftool -P -overwrite_original -tagsfromfile Y:\!temp\x\y\file.ARW -@ iptc2xmp.args -@ exif2xmp.args -XMP:All Y:\!temp\x\y\file.xmp
    1 image files updated

C:\>exiftool -G1 -a -s -*Label* Y:\!temp\x\y\file.xmp

C:\>
"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

lokatz

Rather strange.  I use 12.96 on Windows 11.  The sidecar gets freshly created.  In my testing, I normally look at the .XMP as a text file, not via ExifTool, but I verified that ExifTool also reads the field as '='.

ExifTool is kept in memory and called via an args file, but that shouldn't impact this.  Or will it?


StarGeek

Are you trying to clear the Label tag as part of the args file? It seems like maybe there is an extra equal sign when trying to clear it.

Can you save and share the args file?
"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

lokatz

When I saw this, the first thing I did was checking my code for an erroneous extra '=' but could not find any.

Checking the args file (which gets deleted when I end my program, so I'll need to set a breakpoint for that) is a good idea that didn't occur to me yet, so thanks for that. It usually gets rather large, so let me weed through it and see whether I can find anything.