App doesn't handle sidecars properly when copying files

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

Moderators: xnview, Dreamer

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

App doesn't handle sidecars properly when copying files

Post by jkm »

Under some circumstances, when naming convention filename.extension.xmp is used, the app does not properly "connect" and delete XMP sidecar files, when image files are copied within the app.

This results in image files with "disconnected" sidecars, or extraneous sidecar files.

Settings:
Default xnview.ini
Create or update XMP sidecar: enabled
Naming convention: filename.extension.xmp
Link companion files for the following actions: Delete, Copy/move/rename both enabled
Show companion files: disabled


Steps to reproduce:

1. Start with a file test.jpg that has a sidecar test.jpg.xmp
2. In Browser Ctrl-drag or copy/paste test.jpg to the same folder, to duplicate it.
3. Observe 2 files are created: "test - Copy.jpg" and "test.jpg - Copy.xmp"
4. The xmp file is named incorrectly, and so is not connected as a sidecar to "test - Copy.jpg"

:bug: Sidecar file is named incorrectly when created via copy. The copied image file therefore does not have a valid sidecar file.
Sidecar is named: "test.jpg - Copy.xmp"
Sidecar should be named: "test - Copy.jpg.xmp"

If Filter=Images, the user will not see the extraneous XMP file. The only indication of error is the missing sidecar overlay on "test - Copy.jpg"

5. If "test - Copy.jpg" is then deleted using the app, the mis-named xmp file is NOT deleted. So extra xmp files are left over.

This problem does NOT occur if Naming Convention=filename.xmp