0.93.1 : adding metadata fails silenciously if path is too long

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

Moderators: XnTriq, helmut, xnview, Dreamer

XavierR
Posts: 7
Joined: Tue Sep 26, 2017 6:36 am

0.93.1 : adding metadata fails silenciously if path is too long

Post by XavierR »

XnView: MP 0.93.1 - 64 bit
OS: Windows 10 64bit

I tried to add metadata (IPTC-IIM/XMP) on some photos which are stored on my office files server, with a very long path and a big file name. When I click on "Write" or "Write the files", progress bar appears, but then no change has been written in the files.

Effect: No warning and no new metadata too.

To reproduce:
1.Use photos stored with the maximal lenght path of your system. In my case the whole path uses 248 characters.
2. Select photo(s) and edit IPTC-IIIM/XMP (CTRL+I)
3. Click on Write / Write the files --> Progress bar appears and disappear

Actual behaviour (bug): No warning and no new metadata too. :bug:

Expected behaviour: If metadata ca'nt be written using a workaround, we have to advised that the operation (of metadata update) has failed.
XavierR
Posts: 7
Joined: Tue Sep 26, 2017 6:36 am

Re: 0.93.1 : adding metadata fails silenciously if path is too long

Post by XavierR »

At the beginning, I didn't understood why for some photos, metadatata editing works and why it fails for another... I finally notice that some temporary files where writed in the directory during the operation. I finally understood (because I ever experimented some problems with some too long paths on our server) that it was path length which prevent XnViewMP to create temporary file if maximal length was reached.

So workaround for the user is really simple : I just have to shorten my path (for example shorten a parent folder name) and metadata can be written.

But real problem is that :
  1. there is no warning message telling that metadata update will fail because of path length (but is it really possible?)
  2. there is no warning message telling that metadata update fails (lack of a control?)
  3. there is no warning message telling that metadata update has failed cause of path length (ok, it's a very special case, but...)
User avatar
xnview
Author of XnView
Posts: 44936
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.93.1 : adding metadata fails silenciously if path is too long

Post by xnview »

:bugconfirmed: Thanks to your detailed description
Pierre.
User avatar
xnview
Author of XnView
Posts: 44936
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.93.1 : adding metadata fails silenciously if path is too long

Post by xnview »

and with latest version?
Pierre.
User avatar
AntonK
Posts: 7
Joined: Thu Oct 08, 2020 8:33 am

Re: 0.93.1 : adding metadata fails silenciously if path is too long

Post by AntonK »

XavierR wrote: Mon Sep 30, 2019 3:59 pm [...] path uses 248 characters.
This seems to be an issue with the limit of 260 characters for paths in Windows.
It can be solved via the registry: just add/modify DWORD-value LongPathsEnabled (under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem) setting it to 1.