我magick在R中使用库.
我使用以下命令,但它无法正常工作
shoe <- image_read('F:/photo.jpg')
image_scale(shoe,'382x509')
format width height colorspace filesize
JPEG 382 460 sRGB 0
Run Code Online (Sandbox Code Playgroud)
宽度设置为382但不是高度.所以我按照命令设置高度
image_scale(shoe,'X509')
format width height colorspace filesize
JPEG 423 509 sRGB 0
Run Code Online (Sandbox Code Playgroud)
现在它改变了宽度.有没有办法在调整大小时关闭宽高比?
读了原始的文档这里带来了解决方案:
image_scale(shoe,"382x509!")
# format width height colorspace filesize
#1 JPEG 382 509 sRGB 0
Run Code Online (Sandbox Code Playgroud)