The issue: When you have an landscape image and you want to have a
portrait thumbnail now your library will crop the image, and the same for
portrait image and landscape thumbnail.
The fix:
In the class Kaliko.ImageLibrary.KalikoImage method
public KalikoImage GetThumbnailImage(int width, int height,
ThumbnailMethod method) the padding part:
else if(method == ThumbnailMethod.Pad) {
float hRatio = (float)_image.Height / (float)height;
float wRatio = (float)_image.Width / (float)width;
float newRatio = hRatio > wRatio ? hRatio : wRatio;
int imgHeight = (int)(_image.Height / newRatio);
int imgWidth = (int)(_image.Width / newRatio);
image = new KalikoImage(width, height, _backgroundColor);
Graphics g = Graphics.FromImage(image._image);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(_image, (width - imgWidth) / 2, (height - imgHeight) / 2,
imgWidth, imgHeight);
}
Original issue reported on code.google.com by fr3dr...@gmail.com on 3 Mar 2010 at 2:08
Original issue reported on code.google.com by
fr3dr...@gmail.com
on 3 Mar 2010 at 2:08