'how to change the dimensions of a jpg image in R?

I always resized images in CorelDraw from 1219,20 x 914,40mm to 78.36x51.00 to make photo boards. But now it turns out I have a lot of images in different folders and I needed to create an auto-lop to do this for me. If I were to do this in Corel like I used to do, it would take a lot of time. I have used the the resize function from Magick package, but didn't have obtain sucess.

resize(Image,  "78.36x51.00!")

Error in resize("78,36x51,00!") : 
Not compatible with requested type: [type=character; target=integer].

So I also tried the image_scale function, in this case the dimensions changed, but the size and resolution of the image was much smaller than expected.

 image_scale(Image, "78.36x51.00!")

  
  • Demonstration with the generated image after the resize (photo) and the expected size (white square)

enter image description here

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source