Therefore I can use the following command:
convert <myfilename> -resize x800 -quality 97 <myfilenamenew>
I put this command (with corresponding variables) into a dos batch script. So I can simply drag a file on it and it will be resized.
Fine.
However sometimes I have not a picture in portrait but in landscape mode.
These kind of pictures should be resized so that the width should be 800 pixel.
How can I find out if a picture is in landscape or portrait mode? I need something like:
Code: Select all
if getwidth(<myfilename>) > getheight(<myfilename>) then
convert <myfilename> -resize y800 -quality 97 <myfilenamenew>
else
convert <myfilename> -resize x800 -quality 97 <myfilenamenew>