我正在使用命令行中的ImageMagick来调整图像大小:
convert -size 320x240 image.jpg
然而,我不知道如何确定最终图像的大小。由于这是等比例缩放的图像,新图像很可能是100x240或320x90(而不是320x240)。
我可以调用“convert”命令来调整图像大小并返回新的图像尺寸吗?例如,伪代码:
convert -size 320x240 -return_new_image_dimension image.jpg // returns the new resized image dimensions
identify -format "%[fx:w]x%[fx:h]"
比identify -format "%[w]x%[h]"
更好呢? - mark%w
和%h
还未被支持。但如果fx:
有一些副作用的话,那么我想我也会提到它。很奇怪。我会进行一些测试... - Arjan