Grv
Grv

Reputation: 383

magick image resize

I am using magick library in R.

I am using the following command but it is not working correctly

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

format width height colorspace filesize
JPEG   382    460       sRGB        0

The width is set to 382 but not height. so I set height by following command

image_scale(shoe,'X509')

format width height colorspace filesize
JPEG   423    509       sRGB        0

Now it changed the width. Is there any way to turn off the aspect ratio while resizing?

Upvotes: 9

Views: 5940

Answers (1)

J_F
J_F

Reputation: 10372

Reading the original documentation here brings the solution:

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

Upvotes: 16

Related Questions