From: zapata Date: Sat, 12 Apr 2003 23:18:39 +0000 (+0000) Subject: whoops X-Git-Tag: BEFORE_MERGE_1_1~183 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=d9244b724ae377a09c3da6e9f8710c8cb0457c8c;p=mir.git whoops --- diff --git a/source/mircoders/media/ImageProcessor.java b/source/mircoders/media/ImageProcessor.java index 2e1352d1..e069d056 100755 --- a/source/mircoders/media/ImageProcessor.java +++ b/source/mircoders/media/ImageProcessor.java @@ -90,14 +90,34 @@ public class ImageProcessor { } public void descaleImage(int aMaxSize, float aMinDescale) throws java.io.IOException { - descaleImage(aMaxSize, aMaxSize, aMinDescale); + descaleImage(aMaxSize, aMaxSize, aMinDescale, 0); } - public void descaleImage(int aMaxWidth, int aMaxHeight, float aMinDescale) throws java.io.IOException { + public void descaleImage(int aMaxSize, int aMinResize) throws java.io.IOException { + descaleImage(aMaxSize, aMaxSize, 0, aMinResize); + } + + public void descaleImage(int aMaxSize, float aMinDescale, int aMinResize) throws java.io.IOException { + descaleImage(aMaxSize, aMaxSize, aMinDescale, aMinResize); + } + + /** + * + * Resizes an image to fit inside aMaxWidth and aMaxHeight, provided + * this requires at least aMinResize pixels will be removed from either the width or + * the height + * + * @param aMaxWidth + * @param aMaxHeight + * @param aMinDescale + * @param aMinResize + * @throws java.io.IOException + */ + public void descaleImage(int aMaxWidth, int aMaxHeight, float aMinDescale, int aMinResize) throws java.io.IOException { float scale; scaledImage = image; - if ((aMaxWidth>0 && image.getWidth()>aMaxWidth) || (aMaxHeight>0 && image.getHeight()>aMaxHeight)) + if ((aMaxWidth>0 && image.getWidth()>aMaxWidth+aMinResize-1) || (aMaxHeight>0 && image.getHeight()>aMaxHeight+aMinResize-1)) { logger.info("Scaling image");