Page 1 of 1

Resize without preserving aspect ratio in Magick++

Posted: 2008-03-20T22:32:35-07:00
by Bob-O-Rama
Hi,

I've tried Image::sample() and Image::resize() images to a smaller size by specifying geometries like "1440x720!" or just "1440x720" ) and I very often get a pixel or two shaved off the resulting height or width ( but never both ) of the resulting image. What is the proper way to do this?

As always, thanks!

-- Bob

Re: Resize without preserving aspect ratio in Magick++

Posted: 2008-03-24T18:38:15-07:00
by Bob-O-Rama
The issue, as it turns out, is that creating a Geometry object using "800x600!" e.g.

Code: Select all

Geometry output = "800x600!";
does not set the aspect flag in the object. To get it to work I needed to use

Code: Select all

output.aspect( TRUE );
to get subsequent Image::resize( output ) to work as I needed. Isn't the exclam supposed to do this, or is this working as designed?

-- Bob