Page 1 of 1

How to force resize the images thru API?

Posted: 2007-11-26T10:14:35-07:00
by puncha
How to use the APIs to force "-resize" to ignore the aspect ratio and distort the image so it always generates an image exactly the size specified.

This is done by adding the character '!' to the size through the command lines. But how to achieve this through API?

CLI:
convert dragon.gif -resize 64x64! exact_dragon.gif
convert terminal.gif -resize 64x64! exact_terminal.gif

Re: How to force resize the images thru API?

Posted: 2007-11-26T10:47:02-07:00
by magick
The API resizes the image to the exact dimensions you give. For example, ResizeImage(image,108,97,...) returns an image that is 108x97 pixels regardless of the aspect ratio of the original image.

Re: How to force resize the images thru API?

Posted: 2007-11-26T19:31:26-07:00
by puncha
magick wrote:The API resizes the image to the exact dimensions you give. For example, ResizeImage(image,108,97,...) returns an image that is 108x97 pixels regardless of the aspect ratio of the original image.
Thanks, it works. By the way, does Magick++ expose a force resize function? I don't think Image::resize() provide a force resize.