Page 1 of 1
Redimensionner un répertoire
Posted: Thu Jul 24, 2014 1:29 pm
by VinceBR
Bonjour,
J'ai regardé les divers sujets NConvert qui se rapprochent de mon besoin, mais je n'arrive pas à trouver la bonne syntaxe.
Pour quelqu'un qui ne maîtrise pas trop la gestion d'un ordinateur (navigation dans l'explorateur, création de répertoires...), je souhaite ajouter un script NConvert qui, par clic droit sur un répertoire de photos jpg, y génère un sous-répertoire "1024" qui contient les photos avec un nom identique, mais de taille 1024 au maximum.
La ligne suivante dans le registre
Code: Select all
"C:\Program Files\XnView\nconvert.exe" -ratio -rtype lanczos -rflag decr -resize 1024 768 -o $\1024\ "%1\*.jpg"
me crée bien le sous-répertoire 1024, chaque photo est bien réduite, mais la première porte le nom ".jpg", la seconde "_1.jpg", ... et pas les noms des fichiers originaux.
Une petite astuce pour finaliser le résultat ?
Merci d'avance,
Vince
Re: Redimensionner un répertoire
Posted: Thu Jul 24, 2014 2:07 pm
by cday
VinceBR wrote:Une petite astuce pour finaliser le résultat ?
Bonjour,
NConvert does not support the use of quotes (" ") with wildcards (*) as in
"%1\*.jpg" ...
You can probably avoid the limitation by using a 'DOS'
For ... In ... Do ... loop around NConvert code in a batch file .bat ...
Re: Redimensionner un répertoire
Posted: Thu Jul 24, 2014 5:09 pm
by VinceBR
Thanks cday.
After a few searches on the Internet for DOS loops, I finally obtained a good solution.
The registry (right-click on photo folders) points to a .bat file, which contains the following code :
Code: Select all
cd "%1"
FOR %%i IN (*.jpg) DO "C:\Program Files\XnView\nconvert.exe" -ratio -rtype lanczos -rflag decr -resize 1024 768 -o $\1024\%%_1024.jpg %%i
My mother is happy with this solution, and my wife should be also, when back home !!!
I tried XnConvert as well. I noticed a difference in size between the results of NConvert and XnConvert. Both seems to be jpeg at 80%. I don't know where it comes from.
Re: Redimensionner un répertoire
Posted: Thu Jul 24, 2014 6:30 pm
by XnTriq
VinceBR wrote:I tried XnConvert as well. I noticed a difference in size between the results of NConvert and XnConvert. Both seems to be jpeg at 80%. I don't know where it comes from.
A “
Q factor” of 80 is XnConvert's default compression level for JPEG.
What are your other settings in
Output »
Format »
JPG - JPEG / JFIF, Vince
JPEG options in NConvert:
- -q value : JPEG/PNG/FPX/WIC/PDF quality (default : 100)
-i : Interlaced GIF / Progressive JPEG
-opthuff : Optimize Huffman Table (JPEG)
-dct value : DCT method
- 0 : Slow
1 : Fast
2 : Float
-smoothingf value : Smoothing factor (0-10)
-subsampling value : Subsampling factor
- 0 : 2x2,1x1,1x1
1 : 2x1,1x1,1x1
2 : 1x1,1x1,1x1
-jpegtrans op : JPEG lossless transformations
- rot90 : Rotate 90 degrees
rot180 : Rotate 180 degrees
rot270 : Rotate 270 degrees
exif : Use orientation EXIF tag
vflip : Flip vertical
hflip : Flip horizontal
-jpegcrop x y w h : JPEG lossless crop
-clean value : JPEG Clean Metadata (EXIF/IPTC/...)
- 1 : Comment
2 : EXIF
4 : XMP
8 : EXIF thumbnail
16 : IPTC
32 : ICC Profile
64 : Other markers
-rmeta : Remove Metadata (EXIF/IPTC/...)
-rexifthumb : Remove EXIF thumbnail
What JPEG compression level does NConvert use by default, Pierre
Re: Redimensionner un répertoire
Posted: Fri Jul 25, 2014 5:45 pm
by XnTriq
XnTriq wrote:What JPEG compression level does NConvert use by default, Pierre

OK, the default value seems to be 85.