This code:
Code: Select all
@echo off
identify -format "%f, %w, %h" sprite.jpg
pause
Code: Select all
w, hPress any key to continue . . .
PS:
I'm using ImageMagick 6.9.3-7 Q16 x64 and Windows 7 x64
Code: Select all
@echo off
identify -format "%f, %w, %h" sprite.jpg
pause
Code: Select all
w, hPress any key to continue . . .
Code: Select all
identify -format "%%f, %%w, %%h" sprite.jpg
Code: Select all
for /F "usebackq" %%L in (`identify ^
-format "FILE=%%f\nWIDTH=%%w\nHEIGHT=%%h" ^
sprite.jpg`) do set %%L
This line in a Windows BAT file would take every JPG in the directory and rename it to its original file name, followed by an underscore, followed by WxH, and ending with ".jpg"...AlexNovak wrote:How can I add image dimention into it's filename?
Code: Select all
convert *.jpg -set filename:f "%%t_%%wx%%h" -quality 100 "%%[filename:f].jpg"
Code: Select all
mkdir donefiles
convert *.jpg -set filename:f "donefiles/%%t_%%wx%%h" -quality 100 "%%[filename:f].jpg"