0.51 Win7 x64: keep folder structure doesn't work

Bugs and Suggestions in XnView MP or XnConvert MP which have been resolved.

Moderators: XnTriq, helmut, xnview

Post Reply
bodydomelight
Posts: 3
Joined: Sat Jul 21, 2012 11:21 am

0.51 Win7 x64: keep folder structure doesn't work

Post by bodydomelight »

Keep folder structure doesn't work when only one folder selected.
To reproduce:
- in parent folder ParentFolder create Folder1 with image files;
- set output folder say c:\output;
- set "Keep folder structure" option on;
- Add Folder1 or ParentFolder in batch converter.
Expected result: files are saved into c:\output\Folder1 or c:\output\ParentFolder\Folder1
Actual result: files are saved into c:\output.

- create Folder2 in ParentFolder and add at least one image file to it;
- add ParentFolder in batch converter.
Now files are stored correctly under c:\output\Folder1 and c:\output\Folder2

Also, Add folder... button in batch converter allows to select multiple folders at once but none is added to converter if several folders are selected.
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.51 Windows 7 x64: keep folder structure doesn't work

Post by xnview »

yes, but when you add c:\folder\folder1\folder2\* to batch convert, and you convert in c:\output
The expected result is c:\output\folder\folder1\folder2\ ????
Pierre.
crimsonfin
Posts: 2
Joined: Sun May 05, 2013 7:22 pm

Re: 0.51 Windows 7 x64: keep folder structure doesn't work

Post by crimsonfin »

xnview wrote:yes, but when you add c:\folder\folder1\folder2\* to batch convert, and you convert in c:\output
The expected result is c:\output\folder\folder1\folder2\ ????
I dont understand this response ?

I agree with original poster. Looks to still be an issue in v1.55. If I convert a single folder assuming the following folder structure :

c:\input\photos\source1
c:\input\photos\source2
c:\output

Input tab settings:
- "c:\input\photos\source1"

Output tab settings:
- Keep folder structure - checked
- output folder - "c:\output"

Expected result:
- images in "c:\output\source1"

Actual result:
- images in "c:\output"

Repeat above test but uncheck "Keep folder structure" gives exactly the same results. This implies that "Keep folder structure" setting does nothing when selecting a single folder ?

Repeat above test and select input folder "c:\input\photos"

Expected result:
- images in "c:\output\source1"
- images in "c:\output\source2"

Actual result:
- same as expected result (good!)

Looks like a bug ?

I can also confirm that original posters comment "Also, Add folder... button in batch converter allows to select multiple folders at once but none is added to converter if several folders are selected." is still an issue in v1.55
isildur
Posts: 1
Joined: Wed Jan 08, 2014 7:10 pm

Re: 0.51 Windows 7 x64: keep folder structure doesn't work

Post by isildur »

xnview wrote:yes, but when you add c:\folder\folder1\folder2\* to batch convert, and you convert in c:\output
The expected result is c:\output\folder\folder1\folder2\ ????

1. You could indeed do it that way. (Or even include the drive letter or volume name as c:\output\C\folder\folder1\folder2\... )


2. Alternatively, you could do as follows:
2.1
Assuming c:\folder\folder1\folder2\ contains
c:\folder\folder1\folder2\x.jpg
c:\folder\folder1\folder2\folder3a\
c:\folder\folder1\folder2\folder3a\y.jpg
c:\folder\folder1\folder2\folder3b\
c:\folder\folder1\folder2\folder3b\z.jpg

If a user has only done "Add folder" once, and the folder they chose was "c:\folder\folder1\folder2\", assume that folder is the base. Remember that path so that part can be excluded, and instead save to
c:\output\x.jpg
c:\output\folder3a\
c:\output\folder3a\y.jpg
c:\output\folder3b\
c:\output\folder3b\z.jpg

2.2. However, if the user does "Add Folder" again, add to an explicitly maintained list of user-chosen directories (you already have the first entry from part 2.1.). When it comes time to output, look at the list. Assume as a base path the most specific common directory of the paths on the list.

So if the list says the user chose the 2 folders

c:\folder\folder1\folder2a\folder3\
and
c:\folder\folder1\folder2b\folder3\

, then output to:

c:\output\folder2a\folder3\
and
c:\output\folder2b\folder3\

Note that c:\output does not have any of the other possible contents of folder1-- just subdirectories "folder2a\folder3\" and "folder2b\folder3\".

(Instead of keeping a list, the same thing could also be achieved by updating the base path to the narrowest common parent each time a user does "Add Folder", instead of figuring out the common parent when the user hits "Convert".)
-----------
Whether you go with option 1 or option 2 (option 2 requires somewhat more coding work because you have to either maintain a path list, or update the base path to the narrowest common parent each time a user does "Add Folder"), either way would be better than the current problem of just dumping everything in one folder.
User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by GeorgD »

I tried batch convert in v0.64 and ran in troubles, searched the forum and found this thread. My use case and expectation is what isildur described in 2.1 (XnView classic behaves this way). My use case is simple: I have a folder "Photo Collection" that contains sub-folders for each travel, event etc. The original files are too big (in byte and in pixels) for my smartphone, so I want to create exactly the same structure but smaller images on my phone. I tried Input Folder "Photo Collection", Actions "Rezise", Output phone-folder and checked "Keep folder structure". Result is exactly one folder containing all images, instead of the expected one parent folder and then the sub-folders that contain images.

=> Pierre, what does "Keep folder structure" currently do? It seems to have no effect on the results of batch convert (at least as a user I did not observe any).
=> You can use XnView classic as a workaround.
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by xnview »

GeorgD wrote: => Pierre, what does "Keep folder structure" currently do? It seems to have no effect on the results of batch convert (at least as a user I did not observe any).
=> You can use XnView classic as a workaround.
XnView & XnViewMp works in the same way. 'Keep folder structure' check for the common path of all files, and recreate it
Pierre.
User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by GeorgD »

xnview wrote:XnView & XnViewMp works in the same way.
Hm, here, they seem not to work the same way. Here's what I do:

Source files & directories (result of dir /s/b)

Code: Select all

C:\tmp\sourceParent
C:\tmp\sourceParent\child1
C:\tmp\sourceParent\child2
C:\tmp\sourceParent\child1\Aus dem letzten Jahrhundert.jpg
C:\tmp\sourceParent\child1\Funkenschlag Erweiterung Brasilien und Spanien+Portugal.JPG
C:\tmp\sourceParent\child2\ruthe Geburtstag von Charles Darwin.jpg
XnView classic v2.13: Tools > Batch Processing > Add Folder > C:\tmp\sourceParent, Output directory C:\tmp\target, "keep subfolder structure" activated (everything else disabled). Result:

Code: Select all

C:\tmp\target
C:\tmp\target\child1
C:\tmp\target\child2
C:\tmp\target\child1\Aus dem letzten Jahrhundert.jpg
C:\tmp\target\child1\Funkenschlag Erweiterung Brasilien und Spanien+Portugal.JPG
C:\tmp\target\child2\ruthe Geburtstag von Charles Darwin.jpg
=> the subfolders have been created in the target

XnViewMP v0.64: Tools > Batch convert > Add Folder > C:\tmp\sourceParent, Output Folder C:\tmp\target, "keep folder structure" activated (everything else disabled). Result:

Code: Select all

C:\tmp\target
C:\tmp\target\Aus dem letzten Jahrhundert.jpg
C:\tmp\target\Funkenschlag Erweiterung Brasilien und Spanien+Portugal.JPG
C:\tmp\target\ruthe Geburtstag von Charles Darwin.jpg
=> the subfolders have NOT been created in the target

Attached are the scripts I used (in classic and MP) packed to a .zip as uploading the scripts directly does not work here in the forum ("The extension xbs is not allowed.").
Attachments
Scripts.zip
(881 Bytes) Downloaded 111 times
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by xnview »

GeorgD wrote: XnViewMP v0.64: Tools > Batch convert > Add Folder > C:\tmp\sourceParent, Output Folder C:\tmp\target, "keep folder structure" activated (everything else disabled). Result:

Code: Select all

C:\tmp\target
C:\tmp\target\Aus dem letzten Jahrhundert.jpg
C:\tmp\target\Funkenschlag Erweiterung Brasilien und Spanien+Portugal.JPG
C:\tmp\target\ruthe Geburtstag von Charles Darwin.jpg
=> the subfolders have NOT been created in the target
right, i've changed that, you can try last version of XnConvert...
Pierre.
User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by GeorgD »

xnview wrote:
GeorgD wrote: XnViewMP v0.64: Tools > Batch convert > Add Folder > C:\tmp\sourceParent, Output Folder C:\tmp\target, "keep folder structure" activated (everything else disabled). Result:

Code: Select all

C:\tmp\target
C:\tmp\target\Aus dem letzten Jahrhundert.jpg
C:\tmp\target\Funkenschlag Erweiterung Brasilien und Spanien+Portugal.JPG
C:\tmp\target\ruthe Geburtstag von Charles Darwin.jpg
=> the subfolders have NOT been created in the target
right, i've changed that, you can try last version of XnConvert...
Ehm...did you intentionally change XnViewMP so it has the described behaviour (and shall continue to have it), or did you change this behaviour and we can try the new code in last XnConvert version? :?
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by xnview »

I have changed the behavior in last version of XnConvert, so for last release of XnViewMP :)
Pierre.
User avatar
GeorgD
Posts: 291
Joined: Thu Oct 12, 2006 2:45 pm

Re: 0.51 Win7 x64: keep folder structure doesn't work

Post by GeorgD »

Fixed in v0.68 - now, the small images stay in their folders :-) Thanks, Pierre!
In the XnView Wiki, you can improve the user guide / documentation / F1-help for XnView (classic/Windows) and for XnViewMP
Post Reply