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: 90
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
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 3560
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: 90
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: 3560
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: 90
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: 3560
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: 90
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!)