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
How to force resize the images thru API?
Re: How to force resize the images thru API?
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?
Thanks, it works. By the way, does Magick++ expose a force resize function? I don't think Image::resize() provide a force resize.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.