changeset 469:11e11fe4d680

Improved performance of JAIDocuImage for large images - simulated subsampling by scaling
author robcast
date Wed, 15 Feb 2006 00:09:50 +0100
parents 0fc853d98820
children 16bd70715ac3
files servlet/src/digilib/image/DocuImageImpl.java servlet/src/digilib/image/ImageLoaderDocuImage.java
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/image/DocuImageImpl.java	Tue Feb 14 18:31:18 2006 +0100
+++ b/servlet/src/digilib/image/DocuImageImpl.java	Wed Feb 15 00:09:50 2006 +0100
@@ -45,7 +45,7 @@
 public abstract class DocuImageImpl implements DocuImage {
 
 	/** logger */
-	protected static Logger logger = Logger.getLogger(DocuImage.class);
+	protected static final Logger logger = Logger.getLogger(DocuImage.class);
 	
 	/** Interpolation quality. */
 	protected int quality = 0;
--- a/servlet/src/digilib/image/ImageLoaderDocuImage.java	Tue Feb 14 18:31:18 2006 +0100
+++ b/servlet/src/digilib/image/ImageLoaderDocuImage.java	Wed Feb 15 00:09:50 2006 +0100
@@ -278,11 +278,11 @@
 				if (quality > 1) {
 					// change JPEG compression quality
 					param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
-					logger.debug("JPEG qual before: "
-							+ Float.toString(param.getCompressionQuality()));
+					//logger.debug("JPEG qual before: "
+					//		+ Float.toString(param.getCompressionQuality()));
 					param.setCompressionQuality(0.9f);
-					logger.debug("JPEG qual now: "
-							+ Float.toString(param.getCompressionQuality()));
+					//logger.debug("JPEG qual now: "
+					//		+ Float.toString(param.getCompressionQuality()));
 				}
 				writer.setOutput(imgout);
 				// render output
@@ -335,11 +335,11 @@
 		}
 		logger.debug("scaling...");
 		scaledImg = scaleOp.filter(img, scaledImg);
-		logger.debug("destination image type " + scaledImg.getType());
 		if (scaledImg == null) {
 			throw new ImageOpException("Unable to scale");
 		}
 		// DEBUG
+		logger.debug("destination image type " + scaledImg.getType());
 		logger.debug("SCALE: " + scale + " ->" + scaledImg.getWidth() + "x"
 				+ scaledImg.getHeight());
 		img = scaledImg;
@@ -380,14 +380,14 @@
 			throws ImageOpException {
 		// setup Crop
 		BufferedImage croppedImg = img.getSubimage(x_off, y_off, width, height);
-		logger.debug("CROP:" + croppedImg.getWidth() + "x"
-				+ croppedImg.getHeight());
 		// DEBUG
 		// util.dprintln(2, " time
 		// "+(System.currentTimeMillis()-startTime)+"ms");
 		if (croppedImg == null) {
 			throw new ImageOpException("Unable to crop");
 		}
+		logger.debug("CROP:" + croppedImg.getWidth() + "x"
+				+ croppedImg.getHeight());
 		img = croppedImg;
 	}