Code: Select all
nconvert -ratio -resize 325 -overwrite output.jpeg
Moderators: XnTriq, helmut, xnview
Code: Select all
nconvert -ratio -resize 325 -overwrite output.jpeg
Code: Select all
-o filename : Output filename
Use # to specify position of numeric enumerator
Use % to specify source filename
Use $ to specify full source pathname
Use $$ to specify source folder name
Use $EXIF:DateModified[date format] to specify EXIF date modified
Use $EXIF:DateTaken[date format] to specify EXIF date taken
Date format: Please check documentation of strftime
-out format : Output format name
Code: Select all
** NCONVERT v7.25 (c) 1991-2019 Pierre-E Gougelet (Jan 15 2019/12:05:55) **
Version for Windows Xp/Vista/7 x64 (All rights reserved)
** This is freeware software (for non-commercial use)
output.jpeg : Success
Format : JPEG TrueColor (v1.2)
Name : jpeg
Compression : JPEG
Width : 1280
Height : 720
Components per pixel : 3
Bits per component : 8
Depth : 24
# colors : 16777216
Color model : RGB
Bytes Per Plane : 3840
Orientation : Top Left
Xdpi : Not set
Ydpi : Not set
Page(s) : 1
Comment : Lavc57.107.100
Code: Select all
Width : 1280
Code: Select all
for /f "tokens=1* delims=:" %%a in ('nconvert -info output.jpeg ^|find "[11]"') do (
echo %%a
echo %%b
)
I don't know either, and it unlikely from past experience that anyone else will post a solution...
Code: Select all
nconvert -ratio -resize shortest 180 -o output.jpg -out output222222.jpg
Zuldek wrote: ↑Fri Jul 05, 2019 5:47 pmCannot change the name of the convection image when savingCode: Select all
nconvert -ratio -resize shortest 180 -o output.jpg -out output222222.jpg
Code: Select all
-out format : Output format name
Code: Select all
nconvert -ratio -resize shortest 180 -o output.jpg -out format output222222.jpg
Zuldek wrote: ↑Fri Jul 05, 2019 6:20 pmI tried it and it does not come out (((Code: Select all
nconvert -ratio -resize shortest 180 -o output.jpg -out format output222222.jpg
Code: Select all
@echo off
::Example 1 - request image width
for /f "tokens=2 delims=: " %%a in ('nconvert -info "img.jpg" ^| findstr /C:"Width"') do set WIDTH=%%a
echo Example 1 - The image width is %WIDTH%
::Example 2 - request jpeg format description
for /f "tokens=2 delims=:" %%a in ('nconvert -help ^| findstr /C:"[jpeg"') do set DESCRIPT=%%a
::trim space of the var
for /f "tokens=* eol= " %%t in ("%DESCRIPT%") do set DESCRIPT=%%t
echo Example 2 - The image format description is %DESCRIPT%
::Example 3 - request image multiple infos
setlocal enabledelayedexpansion
set count=1
for /f "tokens=2 delims=:" %%a in ('nconvert -info "img.jpg"') do (
set VAR!count!=%%a
set /a count=!count!+1
)
echo.
echo Example 3 - Print all infos values found:
for /L %%i in (1, 1, !count!) do (
if %%i lss !count! (echo !VAR%%i!)
)
::trim space of selected vars
for /f "tokens=* eol= " %%t in ("%VAR3%") do set VAR3=%%t
for /f "tokens=* eol= " %%t in ("%VAR5%") do set VAR5=%%t
for /f "tokens=* eol= " %%t in ("%VAR6%") do set VAR6=%%t
for /f "tokens=* eol= " %%t in ("%VAR7%") do set VAR7=%%t
for /f "tokens=* eol= " %%t in ("%VAR11%") do set VAR11=%%t
for /f "tokens=* eol= " %%t in ("%VAR12%") do set VAR12=%%t
echo.
echo Example 3 - Var selection:
echo %VAR3% &REM format
echo %VAR5% &REM compression
echo %VAR6% &REM width
echo %VAR7% &REM height
echo %VAR11% &REM color nb
echo %VAR12% &REM color type &REM is just for end line comment
endlocal
Thank you very much for posting your solution for obtaining image parameters from NConvert -info output in a way that enables them to be used as variables in subsequent code; it is a solution to zuldek's problem above, but a similar need has sometimes arisen in other contexts...
I am normally in Linux but can boot into Windows 10 if necessary, but I prefer not to firstly as it disrupts my workflow, and secondly simply because it is Windows 10......oops you are on linux