ImageMagick:获取相对于EXIF方向的图像大小

时间:2014-04-14 08:08:48

标签: imagemagick imagemagick-identify

我知道convert可以使用-auto-orient参数在调整图片大小时正确旋转图像,但我可以使用identify以某种方式获取图像相对于EXIF方向的旋转尺寸吗?

1 个答案:

答案 0 :(得分:1)

标识不支持-auto-orient选项,因此您必须使用convert命令。使用下面的代码,您可以获得图像的尺寸:

// If you only need the width and height
convert -auto-orient image.jpg -format %wx%h info:

// If you want the same result as identify
convert -auto-orient image.jpg info: