0

For example, when I only provide one of the length or width parameters, another parameter is automatically calculated while maintaining the aspect ratio of the image.

Is there a related function in the MagicWand library? Still have to calculate the aspect ratio yourself?

Hentioe
  • 228
  • 1
  • 9
  • https://imagemagick.org/script/convert.php and https://imagemagick.org/MagickWand/resize.htm – 3000 Mar 25 '19 at 08:01

1 Answers1

1

Is there a related function in the MagicWand library? Still have to calculate the aspect ratio yourself?

When working with MagickWand C-API, you would be expected to calculate the aspect ratio yourself. There was MagickTransformImage method that supports both cropping & resizing by evaluating a formatted string (including aspect ratios), but that has been deprecated & removed.

In the MagickCore library, there's ParseMetaGeometry method that will support formatted string w/ aspect ratio flags.

emcconville
  • 23,800
  • 4
  • 50
  • 66