Hi,
I've just started using Imagemagick - thank you, it looks great!
I'm using an android port from here:
https://github.com/puelocesar/android-lib-magick
and I have to use the API directly, so running into some issues. Could anyone help me define the api call to correctly resize an image preserving the aspect ratio? I think I'm close, but can't find an example anywhere after much searching. Here's what I got:
img = new MagickImage(new ImageInfo(filename));
scaledImage = img.zoomImage(dimensions.getHeight(), dimensions.getWidth());
scaledImage.unsharpMaskImage(0, .75, .75, .008);
It almost works, but the aspect ratio is not preserved. I know that its fairly easily done from the command line, but having some troubles seeing the way via the api...
Thank you!
Mark
Imagemagick api
Re: Imagemagick api
Get the image dimensions and compute the aspect ratio of the resized image with simple math. If the API supports TransformImage() you can set a resize geometry as a string and ImageMagick will set the resize dimensions while maintaining the aspect ratio for you.