1.0: "Delete original" should skip when file creation failed

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

Moderators: helmut, XnTriq, xnview, Dreamer

f2d
Posts: 5
Joined: Wed Nov 29, 2017 2:22 pm

1.0: "Delete original" should skip when file creation failed

Post by f2d »

Hi.

XnView: MP 1.0 64-bit (Apr 28 2022)
OS: Windows 10 64-bit

Effect: if source file can be read, but new file cannot be created, original is deleted anyway.

To reproduce:
  1. Open "Batch convert" (Ctrl+U).
  2. Output to "Source folder".
  3. Enable "Delete original".
  4. Input:
    • (a) "Add folder" that contains files with full path longer than 255+ characters.
      For example, 266 characters:

      Code: Select all

      D:\12345678901234567890123456789012345678901234567890\12345678901234567890123456789012345678901234567890\12345678901234567890123456789012345678901234567890\12345678901234567890123456789012345678901234567890\12345678901234567890123456789012345678901234567890\test.png
      Note: only "Add folder" reproduces the bug.
      When I drag&drop to batch input, or drag&drop to viewer and Ctrl+U from there, short 8.3 names are used instead.

      Code: Select all

      D:\123456~1\123456~1\123456~1\123456~1\123456~1\test_1.png : saved
    • (b) Add input files with unicode filename and use output format with plugin.
      For example, output to QOI with https://github.com/pfusik/qoi-ci
      I reported this in https://github.com/pfusik/qoi-ci/issues/8 and was told that it is limitation of XnView plugins, that get question mark characters instead of unicode in paths.
  5. Run batch convert.
Actual behaviour (bug): original is deleted after new file was not created.
Example status report:

Code: Select all

D:\★.png : loading
D:\★.png 456x456x1 : loaded
D:\★.qoi : not a picture

Input files: 1
Extracted pages: 1
New files: 1
Note that "New files: 1", but new file does not exist.

Expected behaviour: new valid file is created, old file is deleted.
Or: no new valid file, old file is kept.

Whatever the underlying causes (which are separate problems), original file should be kept if creation failed.

I personally understand that "Delete original" is dangerous, and only use it to save operational disk space when I have original files in a backup, and I check my results and file counts to match that. Otherwise I keep original files and delete them manually after checking results, if ever.
User avatar
helmut
Moderator
Posts: 8581
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: 1.0: "Delete original" should skip when file creation failed

Post by helmut »

Thank you for reporting this one, f2d. Setting "Delete original" is indeed a bit dangerous but software (here: XnView) must minimize the risk of loosing anything to zero. This problem should be fixed with high priority, I think.
User avatar
xnview
Author of XnView
Posts: 37883
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.0: "Delete original" should skip when file creation failed

Post by xnview »

do you have the problem only with QOI plugin?
Pierre.
f2d
Posts: 5
Joined: Wed Nov 29, 2017 2:22 pm

Re: 1.0: "Delete original" should skip when file creation failed

Post by f2d »

xnview wrote: Thu Jul 21, 2022 12:28 pm do you have the problem only with QOI plugin?
With method (b) - unicode paths - I did not try every available file type.
QOI plugin (qoi-ci, using "Xqoi.usr" file) is the only plugin that I know has this problem, and the only user-installed one I have.
Aside from configs and DB files, everything else I have in XnView MP is from its default setup.

The other method (a) - add folder with overly long paths inside - was reproduced with PNG source saved to PNG, and probably fails to create any files in Windows.
Again, I did not try saving every available file type with this method too.