This project has moved and is read-only. For the latest updates, please go here.

Aspect Ratio

Jun 28, 2013 at 2:19 AM
Edited Jun 28, 2013 at 2:20 AM
I'm trying to size images with a height and width but do not wish to use the Aspect Ratio. Is there currently a way to handle this?
Jun 28, 2013 at 5:56 AM
You should be able to do that by setting the Aspect property of MagickGeometry to true. I will rename that property before the next release to make it less confusing.
using (MagickImage image = new MagickImage("Snakeware.jpg"))
  MagickGeometry geometry = new MagickGeometry(100, 100);
  geometry.Aspect = true;
You will probably get better results when you crop the image:
using (MagickImage image = new MagickImage("Snakeware.jpg"))
  image.Crop(100, 100, Gravity.Center);
Jun 28, 2013 at 11:24 AM
Edited Jun 28, 2013 at 11:36 AM
Thank You!! This library is amazing and cuts down on the hassle of having to constantly save everything on the file system! Keep up the great work!!

I did have one other question and maybe I should have included this in another thread. However, I was wondering how the "Quality" property meshed with the Density setting? I think my expectation was to set the density at say 36,36 and get a lower resolution file with a smaller file size. That seems to happen when the Quality is set low. Your thoughts?

Jun 28, 2013 at 5:04 PM
The density (DPI) does not affect the file size. Here is an interesting article: What kind of image format is your output file? Compression/quality depends on the output format.