Hi,
I'm a Windows 10 user and I want to determine the resolution or orientation (portrait or landscape) of my image files. When I use the following command-line, everything works fine:
magick identify -format "%i:%W:%H\r\n" *.jpg
RESULTS (filename:width:height) :
1.jpg:1920:1080
2.jpg:1920:1080
When I try the same thing in the following batch file (image.cmd):
@echo off
cd "%userprofile%\Pictures"
erase /F image_list
magick identify -format "%i:%W:%H\r\n" *.jpg >> image_list
I get the following RESULTS:
W:H
W:H
WHY ? Can anyone help me or is there a simplier way to do that ?
Thanks!
Desch
Extracting image orientation from a JPEG
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Extracting image orientation from a JPEG
In Windows BAT files, percent % has a special meaning. When you don't want that special meaning, you need to double it:
Code: Select all
magick identify -format "%%i:%%W:%%H\r\n" *.jpg >> image_list
snibgo's IM pages: im.snibgo.com
Re: Extracting image orientation from a JPEG
Hi snibgo,
I forgot that little detail, it seems to work now, thanks!
Desch
I forgot that little detail, it seems to work now, thanks!
Desch