Batch convert -- Saving output to a relative folder

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Batch convert -- Saving output to a relative folder

Post by winnylinny »

A tooltip or explanation needs to more clearly offer a hint when selecting an output folder under Batch Convert.

relative-folder.png

I didn't even know this was possible, until I found out by mistake!

I kept using the "source folder" option, because I did not want to save my converted files to the same folder on my drive every time. Images exist in different albums and folders, so I was hoping there was a way to save the converted files into a relative output folder.

Guess what? It's possible! I just never knew because it was not explained! :shock:

---

This works on Linux, and I assume it is the same with Windows? New users might not know that XnViewMP's batch convert even supports "relative output folder" since no hints are provided. :P

---

EDIT: Here is what it could also look like:
subfolder-option.png
You do not have the required permissions to view the files attached to this post.
Last edited by winnylinny on Sat Feb 04, 2023 12:04 am, edited 1 time in total.
cday
XnThusiast
Posts: 3577
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch convert -- Saving output to a relative folder

Post by cday »

An interesting discovery, possibly not an intended option...? :wink:

Regarding syntax, mightn't a 'slash' be more intuitive, accept either '/' or '\', for example /converted ?

Out of interest, if the named folder does not already exist, is it possibly created automatically when needed?

Regarding documentation, for a developer testing is boring, documentation is even more boring, so volunteers are always welcome... :D
User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Re: Batch convert -- Saving output to a relative folder

Post by winnylinny »

cday wrote: Mon Jan 23, 2023 3:44 pm Out of interest, if the named folder does not already exist, is it possibly created automatically when needed?
Yes. If the folder does not exist, it is automatically created. :)

In fact, you can even specify a further nested relative output folder, such as:
  • converted/webp
  • converted/jpg
  • converted/png
It works as you expect: It will save the newly converted files two folders down relative from the source folder.

This has beautifully improved my workflow. I wish I knew about this feature much earlier! :mrgreen:

I believe more users will benefit if they knew about this feature in Batch Convert.


cday wrote: Mon Jan 23, 2023 3:44 pm Regarding syntax, mightn't a 'slash' be more intuitive, accept either '/' or '\', for example /converted ?
Leading slashes denote an absolute path. This will attempt to save it to the root of the filesystem. This is why if you use the "browse" button to select the output folder, it will use the complete absolute path, which leads with a slash. (In Windows, this is the equivalent of typing C:\converted )
cday
XnThusiast
Posts: 3577
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch convert -- Saving output to a relative folder

Post by cday »

winnylinny wrote: Mon Jan 23, 2023 3:57 pm This has beautifully improved my workflow. I wish I knew about this feature much earlier! :mrgreen:
Maybe Pierre does too? :D

cday wrote: Mon Jan 23, 2023 3:44 pm Regarding syntax, mightn't a 'slash' be more intuitive, accept either '/' or '\', for example /converted ?
Leading slashes denote an absolute path. This will attempt to save it to the root of the filesystem. This is why if you use the "browse" button to select the output folder, it will use the complete absolute path, which leads with a slash. (In Windows, this is the equivalent of typing C:\converted )
Either slash would be incorrect? A slash is normally used in the path to a subfolder?
User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Re: Batch convert -- Saving output to a relative folder

Post by winnylinny »

cday wrote: Mon Jan 23, 2023 5:17 pm Maybe Pierre does too? :D
It's a great feature, and should remain! Accident or not.
Either slash would be incorrect? A slash is normally used in the path to a subfolder?
Any slash put in the beginning of a path is considered "start from the root of the filesystem". Whereas, if you begin with the folder name (without a leading slash), it is interpreted as "start from the current directory".

Any slashes that come later are considered part of the absolute or relative path.



Some examples, if the source folder is /home/cday/Pictures/batch


Typing in /converted will save the converted files into:
  • /converted


Typing in converted will save the converted files into:
  • /home/cday/Pictures/batch/converted


Typing in /home/cday/Pictures/batch/converted will save the converted files into:
  • /home/cday/Pictures/batch/converted


Typing in converted/webp will save the converted files into:
  • /home/cday/Pictures/batch/converted/webp
Last edited by winnylinny on Mon Jan 23, 2023 9:00 pm, edited 2 times in total.
cday
XnThusiast
Posts: 3577
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch convert -- Saving output to a relative folder

Post by cday »

Thanks for the paths explanation, I think that my reasoning was that the Source folder part of the path was implied, so that /converted/some_folder with the slash would be logical. Never mind though, you have now documented a previously undocumented feature that might be useful to others. :D
User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Re: Batch convert -- Saving output to a relative folder

Post by winnylinny »

cday wrote: Mon Jan 23, 2023 7:55 pm Never mind though, you have now documented a previously undocumented feature that might be useful to others. :D
That's why I think a clear explanation or tooltip or "hint" should be printed on this page. It can help more people.


(FYI: I made some REALLY BAD TYPOS in my previous post. :shock: I've correct them!)
User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Re: Batch convert -- Saving output to a relative folder

Post by winnylinny »

I can confirm this works the same in Windows too. :D

I think this should either be:

(1) communicated more clearly (tooltip and description) as I wrote above in my original post

or

(2) a third option should be added to the "Output folder" settings:
  • Source folder
  • Subfolder in source location
  • Folder
The middle option (my feature request), you would type in the name of this subfolder. Choosing this option will place all the converted files into a subfolder from where the source files exist. (This is the same thing as what is already possible that I explained in my original post.)

So for example, if you select "Subfolder in source location", then type "converted" into the text field, all the converted images will be placed into the source location under a subfolder named "converted".
cday
XnThusiast
Posts: 3577
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch convert -- Saving output to a relative folder

Post by cday »

winnylinny wrote: Fri Feb 03, 2023 12:13 am (2) a third option should be added to the "Output folder" settings:
  • Source folder
  • Subfolder in source location
  • Folder
The middle option (my feature request), you would type in the name of this subfolder. Choosing this option will place all the converted files into a subfolder from where the source files exist. (This is the same thing as what is already possible that I explained in my original post.)

So for example, if you select "Subfolder in source location", then type "converted" into the text field, all the converted images will be placed into the source location under a subfolder named "converted".
I would suggest the following detail change:
  • Source folder
  • Source folder subdirectory (or Source folder - Subdirectory)
  • Folder
Otherwise an interesting suggestion that I expect could be easily implemented... :D

The existing Source folder operation when a subfolder name is entered, discovered by chance, need not be changed.
User avatar
winnylinny
Posts: 92
Joined: Fri Apr 17, 2020 5:35 pm

Re: Batch convert -- Saving output to a relative folder

Post by winnylinny »

Perhaps something that looks like this? :D
subfolder-option.png

What do you think, Pierre?
You do not have the required permissions to view the files attached to this post.
user0
Posts: 291
Joined: Sat May 09, 2015 9:37 am

Re: Batch convert -- Saving output to a relative folder

Post by user0 »

I really doubt there shall be more than one field for path

if go 'explicit' way, I think just adding 'Relative path' checkbox would be enough,
but tbh I would not bother and only add on_hover tooltip and describe it in wiki