Changing the size of the magician

I am using a library magick

in R.

I am using the following command but it doesnt work correctly

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

format width height colorspace filesize
JPEG   382    460       sRGB        0

      

Width is set to 382 but not to height. so I set the height by following the command

image_scale(shoe,'X509')

format width height colorspace filesize
JPEG   423    509       sRGB        0

      

Now it has changed the width. Is there a way to turn off the aspect ratio when resizing?

+3


source to share


1 answer


Reading the original documentation here brings a solution:



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

      

+6


source







All Articles