Conversion with subfolders

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Post Reply
Didi

Conversion with subfolders

Post 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.
User avatar
xnview
Author of XnView
Posts: 43598
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: nconvert subfolders

Post 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...
Pierre.
maxteo

interesting

Post 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 ..
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: nconvert subfolders

Post 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".
XeL

Post by XeL »

When will the -r option be available?
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post 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.
Andys
Posts: 13
Joined: Wed Jun 04, 2008 7:14 am

Post 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
nget

Help with subdirectories

Post 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
Post Reply