description gets corrupted after batch rename

Older bugs which are supposed to be fixed in 0.84. *** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: XnTriq, helmut, xnview, Dreamer

gwong
Posts: 5
Joined: Sun Feb 05, 2023 10:25 pm

description gets corrupted after batch rename

Post by gwong »

After inserting a few new filenames testfile_001.mp4, testfile_002.mp4, testfile_003.mp4, testfile_004.mp4, testfile_002a.mp4, testfile_002b.mp4, testfile_003a.mp4. and testfile_003b.mp4, then performing a btach rename with mask testfile_### extension mp4 and start 1, I was randowmly losing descriptions and descriptions were appearing on the wrong files.

Before the batch rename, the description fie would look normal such as:

"testfile_001.mp4" Comment 1
"testfile_002.mp4" Comment 2
"testfile_003.mp4" Comment 3
"testfile_004.mp4" Comment 4

After the batch rename, the description file contain both real and temporarily files such as:

"tmp-xnview-412-testfile_001.mp4" Comment 1
"tmp-xnview-100-testfile_002.mp4" Comment 2
"tmp-xnview-202-testfile_003.mp4" Comment 5
"tmp-xnview-62-testfile_004.mp4" Comment 6
"tmp-xnview-102-testfile_005.mp4" Comment 3
"tmp-xnview-41-testfile_006.mp4" Comment 7
"tmp-xnview-12-testfile_007.mp4" Comment 8
"tmp-xnview-33-testfile_008.mp4" Comment 4
"testfile_002a.mp4" Comment 5
"testfile_002b.mp4" Comment 6
"testfile_003a.mp4" Comment 7
"testfile_003b.mp4" Comment 8
"testfile_001.mp4" Comment 1
"testfile_002.mp4" Comment 2
"testfile_003.mp4" Comment 3
"testfile_004.mp4" Comment 4
User avatar
masterjp
Posts: 456
Joined: Fri Feb 13, 2009 4:37 pm
Location: Duesseldorf, Germany

Re: description gets corrupted after batch rename

Post by masterjp »

Maybe XnViewMP has a problem with filenames which already exists.

Please try to rename your files to testfile_####.mp4 and then convert them to testfile_###.mp4 again to have a correct order.
PC: Intel 8700k + Asus Z370-F + 16 GB RAM G.Skill + Asus RTX 3050 OC + Samsung SSD
OS: Windows 10 Pro 64bit 22H2 |
GFX: XnViewMP 1.8.3 | XN-View 2.52.0 | XnConvert 1.102.0 | Adobe Photoshop Elements 2024 | Elements XXL 11 | Paint.Net 5.1.1
gwong
Posts: 5
Joined: Sun Feb 05, 2023 10:25 pm

Re: description gets corrupted after batch rename

Post by gwong »

I think I see what is happening. There may be a single image of descript.ion being kept instead of two images: a before image for rollback recovery and an after image with the final result. I did a few simple file renames and found the following in the descript.ion.

"skkkkat_080.mp4" 1607 012
"skkkkat_080a.mp4" xxx ***
"skkkkat_080b.mp4" xxx ***
"skkkkat_081.mp4" xxx
"skkkkat_082.mp4" xxx
"skkkkat_083.mp4" xxx
"skkkkat_084.mp4" xxx
"skkkkat_085.mp4" xxx

Where skkkkat_080a.mp4 and skkkkat_080b.mp4 were added and renamed to skkkkat_081.mp4 and skkkkat_082.mp4 and the original skkkkat_081.mp4, skkkkat_082.mp4 and skkkkat_083.mp4 were renamed to skkkkat_083.mp4, skkkkat_084.mp4 and skkkkat_085.mp4.

Ideally bot skkkkat_080a.mp4 and skkkkat_080b.mp4 should not be in descript.ion because they no longer exist.

I shall need to do further testing to determine whether the description is being forwarded from skkkkat_080a.mp4 and skkkkat_080b.mp4 to skkkkat_081.mp4 and skkkkat_082.mp4, or whether using a single image of descript.ion creates an anormal behavior.
gwong
Posts: 5
Joined: Sun Feb 05, 2023 10:25 pm

Re: description gets corrupted after batch rename

Post by gwong »

Batch rename does not seem to work well with description. With the list sorted by file name, I inserted a new file skkkkat_371a.mp4 with a comment then batch renamed files skkkkat_372.mp4 through skkkkat_524.mp4 to skkkkat_373.mp4 through skkkkat_525.mp4, then individually renamed file skkkkat_371a.mp4 to skkkkat_372.mp4.

From the display, everything appeared correct but behind in descript.ion, it was not.

Files skkkkat_001.mp4 through skkkkat_371.mp4 which were untouched, was in sync between the file display and descript.ion.

File skkkkat_371a.mp4 which was individually renamed was also in sync between the file display and descript.ion.

However, files skkkkat_372.mp4 through skkkkat_524.mp4 which were batch renamed to skkkkat_373.mp4 through skkkkat_525.mp4 only appear to have the properly assigned values in the file display but were unassigned in description. Thus, when I attempt to edit a description shown for one of these files, the editor always displayed a NULL value regardless of the value on the file display.

When I examined description, I found that entries for files skkkkat_372.mp4 through skkkkat_524.mp4 have been replaced by entries for tmp-xnview-0-skkkkat_372.mp4 through tmp-xnview-152-skkkkat_524.mp4 and these tmp- files all had the proper description. It appears an intermediate rename was performed before the files were physically placed to the final names skkkkat_373.mp4 through skkkkat_525.mp4.

I though perhaps a collision in file name space prevented the completion of the file names in descript.ion, so I performed a test where I renamed files skkkkat_215.mp4 through skkkkat_525.mp to tmp_skkkkat_216.mp4 through tmp_skkkkat_526.mp to avoid name collision and I got the same result. Files skkkkat_215.mp4 through skkkkat_525.mp disappeared from descript.ion and were replaced with tmp-xnview-0-skkkkat_215.mp4 through tmp-xnview-310-skkkkat_525.mp4. Now it seems, the break is in batch rename not completing the replacement of the temporary file names with the final file names.
gwong
Posts: 5
Joined: Sun Feb 05, 2023 10:25 pm

Re: description gets corrupted after batch rename

Post by gwong »

I found the same issue reported earlier at this thread.

viewtopic.php?f=95&t=44685&e=1&view=unread#unread

I will be moving my post to this thread.
User avatar
xnview
Author of XnView
Posts: 44885
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: description gets corrupted after batch rename

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Pierre.
User avatar
xnview
Author of XnView
Posts: 44885
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: description gets corrupted after batch rename

Post by xnview »

This problem is supposed to be fixed in XnView MP 1.6.0. Please check and confirm the bug fix here.
Pierre.