Data Integrity: Edit IPTC writes master files when it shouldn't

*** Please report new bugs here! ***

Moderators: xnview, Dreamer

jkm
Posts: 402
Joined: Sat May 11, 2024 12:43 am

Data Integrity: Edit IPTC writes master files when it shouldn't

Post by jkm »

Ok, a bug report that Pierre actually asked for...

There are several issues with the Edit IPTC and Edit XMP functions, and generally a review and overhaul of these functions is needed. But the highest priority issue at the moment is one of data integrity.

:bug: The Edit IPTC function sometimes modifies master files when it should not.

When a user has XnViewMP configured to use Sidecar Files with the following options:
Create or Update XMP Sidecar=ON
Update Master File=OFF

The expectation is that metadata changes will be written to the sidecar file and NOT to the master file. That is the whole point of "Update Master File=OFF"

:bug: When Edit IPTC is used with mode "XMP Only", and "Create or Update XMP Sidecar=ON" & "Update Master File=OFF", XnViewMP still writes to the master file. This should not happen.

Edit IPTC has several option modes: "XMP Only", "XMP update or create IPTC", "IPTC create or update XMP", and "IPTC-IIM only".

These modes are not documented and are not well understood, but it would seem clear the intention of "XMP Only" is to use IPTC<->XMP mappings to encapsulate IPTC metadata in XMP. This is a known capability, and is referenced in IPTC documentation:
"Be aware that IPTC Core and IPTC Extension fields can be saved as XMP "sidecar files" for camera Raw files as some of these file formats do not support embedded metadata."
https://www.iptc.org/std/photometadata/ ... userguide/

I think Pierre feels that "XMP Only" is an option that should be removed, but I think it should stay. IPTC encapsulation in XMP is an essential function for metadata compatibility. But the function does need to be tamed, so it performs appropriately, by honoring the global metadata sidecar/master-file settings. I think the "XMP Only" option has a place alongside other options to preserve the capability to solely use IPTC encapsulation in XMP.

It is debatable what should happen when the remaining mode options are used, but certainly in the case of "XMP Only" the master file should not be touched when the explicit settings made by the user are to not touch it.

In some use cases it is important to be able to maintain the originality of source files, and the enforcement of sidecar rules allows this. Writing the master file when told not to causes a data integrity issue.

Steps to Reproduce:
Settings:
Create or Update XMP Sidecar=ON
Update Master File=OFF
Edit IPTC Options Mode: XMP only

1. Edit IPTC
2. Make a change to Caption, or Keywords. Click Write.
:!: :bug: The master file is altered, even though Update Master File=OFF.
:!: The XMP file is NOT written until "Update Catalog from files" is done. I think not updating the XMP immediately is bad behavior.

Expected behavior: master file untouched, XMP sidecar written immediately.

(Master file is also written with "XMP, update or create IPTC" , and "IPTC create or update XMP".)

Note: The "Edit XMP" dialog behaves differently and does not have a similar problem. If "Edit XMP" is used, and Edit XMP Options Mode="XMP and IPTC", the master file is not touched and the sidecar file is updated immediately. This is good behavior.