ImageMagick不正确的尺寸
问题描述:
我已经在这个问题上好几个小时了。我无法正确裁剪/调整某个图像的大小。ImageMagick不正确的尺寸
源图像具有的900x398 px
一个尺寸的目标尺寸是650x178 px
但返回的尺寸是647x178 px
。我没有得到它。这是我使用的命令:
/usr/bin/convert jpg:"/location/20-prefab_woningen.jpg" -auto-orient -shave 0x78 -resize 650x174 -colorspace RGB "location/new.jpg" &&exit
这是一个常见的错误?我在网上找不到关于它的任何内容。 ImageMagick版本似乎并不重要,尝试本地和服务器,但我得到相同的结果。
答
resize
试图将合适将图像转换为指定的尺寸。它并不强迫它达到这个尺寸。请参阅manual。使用!
标志告诉IM忽略长宽比。
/usr/bin/convert jpg:"/location/20-prefab_woningen.jpg"
-auto-orient -shave 0x78
-resize 650x174\!
-colorspace RGB "location/new.jpg" &&exit
thnx,没有\和与!它完美地工作。谢谢,你的救星:) – nightfox89 2011-05-03 14:02:59