Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Bugs which are supposed to be fixed in the next test version (not available yet)

Moderators: xnview, Dreamer

KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

I'm not sure if the following is a bug or me not understanding something, so I'll start here in General Support.

When modifying XMP or IPTC data on multiple images at once, the "Options" tab has three choices:

Keep and add new value (Keywords [and supplemental categories])

Keep original value if new value is empty

Replace only if original value is empty

The following concerns only the last two.

Here's what's happening to me:

Select multiple images that have star ratings in them > Metadata > Edit XMP > ("Don't load field values" is checked) > Options tab:

"Keep and add new value (Keywords)" is checked

"Keep original value if new value is empty" is checked

"Replace only if original value is empty" is unchecked (because I want to change an existing value)

> Description tab > put new value in "Author" > Click "Write to all files"

⇒ This erases my star ratings.

When "Replace only if original value is empty" is checked, the star ratings do not change.

But this doesn't make sense to me. I am NOT putting a new value into the star rating, so this latter should be considered to have an "empty" new value. Thus, it seems to me, that a checked "Keep original value if new value is empty" should protect the star ratings...

But that's not what happens.

In this case at least, XnView seems to consider the default rating of no stars NOT as an "empty" value but as a rating of zero stars. This would explain why having an unchecked "Replace only if original value is empty" lets XnView change the star rating, but having it checked doesn't.

Donc, am I simply daft? Is this a bug? Or is this just something we need to live with?

Thanks in advance to all!
User avatar
xnview
Author of XnView
Posts: 48436
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by xnview »

do you have the problem only with rating?
KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

I'll see if I can test that.

In my metadata work, I only use author, copyright notice, keywords and ratings. So, no, I haven't seen it elsewhere, but I can make a test folder.

More info coming soon then.
KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

KLE-France wrote: Wed Jul 15, 2026 7:28 am More info coming soon then.
Allez ! No time like the present, no present like time.

TLDR: This appears to affect only the star rating.

So, what I did was to collect a sample of images from different cameras, all with ratings, and put them in a separate folder.

I then picked two, and filled every box in every tab of the Edit XMP interface with a sample text and wrote that data into those two files.

I then selected all of the images, opened them in Edit XMP, made sure that all three options ("Keep and add new value (Keywords)", "Keep original value if new value is empty", "Replace only if original value is empty") were checked, changed the author name and clicked "Write to all files." As expected, this did nothing to any of the files; "Replace only if original value is empty" played its role as a protector of current information. All files had all their "entrance" information, including the two files filled with sample text.

I then selected all of the images again and opened them again in Edit XMP. This time, I left "Keep and add new value (Keywords)" and "Keep original value if new value is empty" checked, but I unchecked "Replace only if original value is empty". Bis repetita, I changed the author name and clicked "Write to all files". This, as before, made my star ratings disappear (rather, I think, it re-wrote all files to no stars). However, no other fields, including in the two images completely filled with sample texts, were affected. So, everyone lost their stars, but no one lost any other information.

I did the above as well with Edit IPTC. IPTC doesn't carry ratings, but I did want to see if there were fields therein suffering from the same thing. There were none, as far as I can determine.

Hope that helps et bonne journée !
User avatar
xnview
Author of XnView
Posts: 48436
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by xnview »

please send us sample files to reproduce
KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

xnview wrote: Fri Jul 24, 2026 8:23 am please send us sample files to reproduce
Not really sure how that's going to help because this happens with simple jpegs...

Here's three images:

1) In their "native" form (full-size jpegs exported from Affinity Photo at 100% quality after having been developed from raws, with AP exporting their metadata into the jpeg (exif data from the camera and added keywords)), all three showed exactly the behavior described above.

2) in the form submitted here (the jpegs resulting from 1), all metadata stripped from them using Metadata > Clean > all boxes checked. Then reduced in size. Then, metadata added back into them using the Metadata > Edit XMP function. Then submitted to what is described above), all three showed exactly the behavior described above.

I've re-stripped the metadata so you're starting fresh:

FSC_7905-small.jpg
FSC_7983-small.jpg
FSC_7943-small.jpg

To reproduce:

First, in Metadata > Edit XMP > make sure "Don't load field values" is checked. Then select all three of the images > Metadata > Edit XMP > make sure all three Multiple Selection choices are checked on the Options tab > add in whatever metadata you want, including something in the Author box on the Description tab > click "Write to all files" (while there, you can add a rating to one or two of the images independently (or, in any case, do so somewhere along the line; before after, whenever) and close the XMP window.

What you wrote into the files will be present, including the star rating that you gave to one or two images.

Now, reopen the images in Metadata > Edit XMP > uncheck "Replace only if original value is empty" on the Options tab (leave the two others checked) > Description tab > Change Author name > click "Write to all files" and close the XMP window.

The file(s) that had a star rating will now report zero stars. Note that the rating tag is still there, but it has been changed to zero stars.

Happy bug hunting!
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 48436
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by xnview »

KLE-France wrote: Mon Jul 27, 2026 4:54 pm Now, reopen the images in Metadata > Edit XMP > uncheck "Replace only if original value is empty" on the Options tab (leave the two others checked) > Description tab > Change Author name > click "Write to all files" and close the XMP window.

The file(s) that had a star rating will now report zero stars. Note that the rating tag is still there, but it has been changed to zero stars.
Ok, i can reproduce. If you uncheck "Replace only if original value is empty", the rating from dialog will be written. Do you think that rating must not follow this setting?
KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

xnview wrote: Thu Jul 30, 2026 8:14 am
If you uncheck "Replace only if original value is empty", the rating from dialog will be written. Do you think that rating must not follow this setting?
I think when no change is made to the rating, it needs to be considered an empty value.

The two commands: "Replace only if original value is empty" and "Keep original value if new value is empty" function on that idea of an empty value.

However, an unchanged rating in the dialog is not considering itself to be empty value, but rather a rating of zero, and is thus writing itself in if the protection conferred by "Replace only if original value is empty" is not active.

So, yes, if no change is made to the rating, it needs to be programmed as an empty value. In that way, "Keep original value if new value is empty" will protect the file from this unwanted rating change.

This may obligate the addition of zero stars as a choice??? (currently the user can only choose between one and five stars)

Of course, XnView sees an image with no XMP rating tag as having zero stars. But I could imagine people wanting to write a rating of zero stars into the XMP data... maybe.

Hope that helps and thanks again for your attention on this.
User avatar
xnview
Author of XnView
Posts: 48436
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
KLE-France
Posts: 152
Joined: Mon Jan 14, 2019 3:00 pm

Re: Making sense of choices at Metadata > Edit XMP(IPTC) > Options. Or maybe a bug?

Post by KLE-France »

Merci à vous surtout!

Concerning adding zero stars, I was rethinking that this morning, and I do think that the Metadata > Edit XMP function should offer zero stars as a choice, just to make it coherent with Metadata > Set rating, where assigning zero stars is available, and, if chosen, writes the tag into the XMP data.

That's one more so for "Suggestions" now here in "Fixed in next version," but hey :)