9

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?

Richard Telford
  • 9,558
  • 6
  • 38
  • 51
Grv
  • 273
  • 3
  • 14

1 Answers1

16

Reading the original documentation here brings the solution:

image_scale(shoe,"382x509!")
#  format width height colorspace filesize
#1   JPEG   382    509       sRGB        0
J_F
  • 9,956
  • 2
  • 31
  • 55