Hello,
I've tried few image converters and XnView seems to be the most easy and completely tunable one! Good job!
I convert a lot of pictures at once.
1. resize to 800x600 to "results" folder;
2. rename result files (add "_800x600" to their filenames);
3. resize initial files to 150x150 to "results" folder;
I have saved settings for both resizes to two batch processing files.
But I couldn't add a rename operation to save it to batch processing file.
How do I create just one batch processing file to save the whole script to do all the job?
How to do batch processing resize-rename-resize?
Moderators: helmut, XnTriq, xnview
Re: How to do batch processing resize-rename-resize?
Sorry, but I couldn't figure out how to do that with NConvert :(
I searched this forum but to no success.
I've read Usage.txt but sample codes didn't work for me
Could you please give me a working code for my case?
I searched this forum but to no success.
I've read Usage.txt but sample codes didn't work for me
Could you please give me a working code for my case?
Re: How to do batch processing resize-rename-resize?
For example:
Code: Select all
nconvert -ratio -rtype linear -resize 800 600 -out jpeg -o results/$_800x600 file.jpg
nconvert -ratio -rtype linear -resize 800 600 -out jpeg -o results/$ file.jpg
Pierre.
FIXED: Re: How to do batch processing resize-rename-resize?
Thanks Pierre!
It worked from command line (I had to rearrange it a little, though):
But I still can't make it work as part of a batch file. It resizes to "results" folder but doesn't add "_800x600" suffix:
Could you please correct it so it added the "_800x600"?
UPD: I've found the problem. It was spaces after "set _f=%~nx1" and "set _n=%~n1"
After deleting those spaces everything started working just fine!
Thanks again!
It worked from command line (I had to rearrange it a little, though):
Code: Select all
nconvert -ratio -rtype linear -resize 800 600 -out jpeg -o $results/%_800x600 file.jpg
Code: Select all
@echo off
:: create results folder
md results
:: go through a loop to process each *.jpg file with nconvert.exe
for %%a in (*.jpg) do call :_resize %%a
goto :eof
:_resize
set _f=%~nx1
set _n=%~n1
:: This line worked from command line: nconvert -ratio -rtype linear -resize 800 600 -out jpeg -o $results/%_800x600 file.jpg
nconvert -ratio -rtype lanczos -q 45 -resize 800 600 -out jpeg -o $results/%_n%_800x600.jpg %_f%
goto :eof
:: end of file
:eof
UPD: I've found the problem. It was spaces after "set _f=%~nx1" and "set _n=%~n1"
After deleting those spaces everything started working just fine!
Thanks again!