魔术图像调整大小

magick image resize

我正在使用 magick R 中的库。

我正在使用以下命令,但它无法正常工作

shoe <- image_read('F:/photo.jpg')
image_scale(shoe,'382x509')

format width height colorspace filesize
JPEG   382    460       sRGB        0

宽度设置为 382 但不是高度。所以我通过以下命令设置高度

image_scale(shoe,'X509')

format width height colorspace filesize
JPEG   423    509       sRGB        0

现在它改变了宽度。有没有办法在调整大小时关闭纵横比?

阅读原始文档here 得出解决方案:

image_scale(shoe,"382x509!")
#  format width height colorspace filesize
#1   JPEG   382    509       sRGB        0