Page 1 of 1

Conversion with subfolders

Posted: Wed Feb 08, 2006 11:59 am
by Didi
Is it possible to change the dpi of images which are diveded in several subfolders with only one command??
nconvert -quiet -out 100 -dpi JPEG target/*.jpg
I know the root directory but i didnt know the names of the subfolder in it. So I need an option like -r.

Re: nconvert subfolders

Posted: Wed Feb 08, 2006 1:00 pm
by xnview
Didi wrote:Is it possible to change the dpi of images which are diveded in severall subfolders with only one command??
nconvert -quiet -out 100 -dpi JPEG target/*.jpg
I know the root directory but i didnt know the names of the subfolder in it. So I need an option like -r.
I'll add a -r option...

interesting

Posted: Sat Mar 11, 2006 6:40 pm
by maxteo
interesting, but this can be done with some scripts:

for exemple:
Create two files with Script with

*****************SCRIPT de lancement.bat *******************
Setlocal

set REPimages=C:\Sizer_img
set REPscripts=C:\Sizer
set REPnconvert=C:\Sizer\Nconvert-win

c:
cd /d %REPimages%

for /D %%R in (*.) do call %REPscripts%\Sizer_rep.bat "%%R"

Endlocal

*****************SCRIPT Sizer_rep.bat *******************
cd /d "%1"

nconvert ...... *.jpg ......
Echo répertoire "%1" traité

for /D %%R in (*.) do call %REPscripts%\Sizer_rep.bat "%%R"
cd ..

Re: nconvert subfolders

Posted: Sat Mar 11, 2006 9:02 pm
by helmut
xnview wrote:
Didi wrote:Is it possible to change the dpi of images which are diveded in severall subfolders with only one command??
nconvert -quiet -out 100 -dpi JPEG target/*.jpg
I know the root directory but i didnt know the names of the subfolder in it. So I need an option like -r.
I'll add a -r option...
Hurray! That will make a difference to nconvert, since this is often needed.

See also topic "Recurse subdirectories".

Posted: Sat Mar 17, 2007 6:37 pm
by XeL
When will the -r option be available?

Posted: Sat Mar 17, 2007 8:30 pm
by helmut
XeL wrote:When will the -r option be available?
I've just updated and browsed the command line options, but there's still no -r for recursing subdirs available.

I've added this to the Global Request & Suggestion list and will point Pierre to this feature request.

Posted: Mon Jun 16, 2008 8:04 am
by Andys
Temporary solution I use (WindowsXP) -
cmd file, from this thread - http://newsgroup.xnview.com/viewtopic.php?t=204

modified to look like this -

@for /R /D %%a in (*) do nconvert.exe <your_options_here> "%%a\*.*"

I added /D switch, it prevents running nconvert exe for each single file. Instead, it runs nconvert for each subdirectory (note the "\*.*" file mask at the end). Should be faster this way.


// EDIT
For me, previous sample didn't work when there were spaces in dir names.
Here's an update -

@for /R /D %%a in (*) do nconvert.exe <your_options_here> %%~sa\*.*

~s is a documented 'for' feature, it converts to short path

Help with subdirectories

Posted: Tue Sep 02, 2008 4:11 pm
by nget
I have several folders (400) in this structure:

\stock\#item_id#\foto\preview

where #item_id# is variable

in the foto subfolder there is a jpg called something_1.jpg

i need to nconvert that jpg and save the result in his "preview" subfolder

Can someone help me with the script?

Thanks in advance!

nget