Questions to option -wm

Started by herb, March 27, 2013, 06:47:13 AM

Previous topic - Next topic

herb

Hallo Phil,

With version 9.14 a new option "-wm wcg" was introduced in ExifTool.
I did some tests with this option on a XP Windows system using the windows executable.
I used version 9.23 of Exiftool and I tested with *.jpg files only.


1) Writing one single tag

I have a JPG file that does not contain any xmp tags.

Both commands
exiftool -wm c -xmp-dc:creator=name <file_without_xmp>
exiftool -wm g -xmp-dc:creator=name <file_without_xmp>

do not update the file. This is correct for me.

But in case of other XMP tags e.g.: -xmp-exif:datetimeoriginal is also available in the file the command
exiftool -wm c -xmp-dc:creator=name <file_without_xmp>
updates the file.

From this behaviour I learn that the helptext "g - create new Groups as necessary" means:
Groups is on EXIF, IPTC and XMP level only. It is not on level e.g.: -XMP-dc.
Is this correct?


2) Copying tags from another file

I have 2 JPG files: one file that contains xmp tags and another file without any xmp tag.
A display of all tags for both files does not give any warning or error message.
But (maybe it is important) ExifIFD contains the tag usercomment, and in both files this tag contains unicode characters.

For command
exiftool -wm g -tagsfromfile <file1_with_xmp> -xmp <file2_without_xmp>
I get the error message:
   Warning: No writable tags set from <file1_with_xmp>

For command
exiftool -wm c -tagsfromfile <file1_with_xmp> -xmp <file2_without_xmp>
I get the error message:
   Warning: [Minor] Entries in ExifIFD were out of sequence. Fixed. <file2_without_xmp>

I am wondering about this warning. A display of all tags still does not give any warning or error message.
Repeating the command I always get the identical error message.


Now I have copied the xmp tags with command
exiftool -tagsfromfile <file1_with_xmp> -xmp <file2_without_xmp>
But I had to send this command twice, because the first command gave also the above warning.
The second command copied the tags without any warning or error message.


After copying the tags for the following command
exiftool -wm c -tagsfromfile <file1_with_xmp> -xmp <file2_now_with_xmp>
I get the error message:
   No namespace for XMP, Warning: Can't write XMP:XMP (namespace unknown) <file2_now_with_xmp>

The command (without -wm)
exiftool -tagsfromfile <file1_with_xmp> -xmp <file2_now_with_xmp>
still works properly.

Are these error messages correct?

Thanks for your comments in advance.
Herb

Phil Harvey

#1
Hi Herb,

Quote from: herb on March 27, 2013, 06:47:13 AM
From this behaviour I learn that the helptext "g - create new Groups as necessary" means:
Groups is on EXIF, IPTC and XMP level only. It is not on level e.g.: -XMP-dc.
Is this correct?

This is true for XMP and IPTC (the family 0 group), but for EXIF it applies to the specific IFD (family 1).  I need to mention this in the documentation. 

QuoteWarning: [Minor] Entries in ExifIFD were out of sequence. Fixed. <file2_without_xmp>

I am wondering about this warning. A display of all tags still does not give any warning or error message.
Repeating the command I always get the identical error message.

This is something that is not checked when reading.  In general, the writer performs more checks than the reader.

QuoteNow I have copied the xmp tags with command
exiftool -tagsfromfile <file1_with_xmp> -xmp <file2_without_xmp>
But I had to send this command twice, because the first command gave also the above warning.
The second command copied the tags without any warning or error message.

It should have worked the first time.  This warning is informational only.

QuoteAfter copying the tags for the following command
exiftool -wm c -tagsfromfile <file1_with_xmp> -xmp <file2_now_with_xmp>
I get the error message:
   No namespace for XMP, Warning: Can't write XMP:XMP (namespace unknown) <file2_now_with_xmp>

Thanks.  It looks like I have some work to do.  Honestly, I was thinking about individual tags and not writing as blocks when I added the -wm option.  I will look into this.

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

Phil Harvey

#2
OK, I looked into the "Can't write XMP:XMP" warning.

I think ExifTool is behaving correctly (not writing XMP as a block because it already existed before), but I have fixed it so that the warning won't be generated.  This update will appear in ExifTool 9.25.

I will also test the new -wm feature with block writing, and improve the documentation to make it clear what groups are meant.

- Phil

Edit: I did some more testing.  The behaviour was wrong when using "-wm cg" and writing a metadata block.  It would never write the block, even though it should if it didn't already exist.  The way I see it, you should need both "c" and "g" enabled to write the block if it didn't exist before, and "w" to write the block if it already existed.  This behaviour will be implemented in version 9.25.  Also, I have added this description (although I found it difficult to make this clear and concise).:

    The level of the group is the SubDirectory level in the metadata structure.
    For XMP or IPTC this is the full XMP/IPTC block (the family 0 group), but
    for EXIF this is the individual IFD (the family 1 group).


... but I am open to suggestions.
...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 ($).

herb

Hallo Phil,

thanks for the corrections.
I have tested with version 9.26 and the "strange warnings" do not appear anymore.

Best regards
Herb