# HG changeset patch # User robcast # Date 1139958590 -3600 # Node ID 11e11fe4d6804e7872944687b975827e22419eab # Parent 0fc853d98820ad858aa956b96f19c9660ba73510 Improved performance of JAIDocuImage for large images - simulated subsampling by scaling diff -r 0fc853d98820 -r 11e11fe4d680 servlet/src/digilib/image/DocuImageImpl.java --- 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; diff -r 0fc853d98820 -r 11e11fe4d680 servlet/src/digilib/image/ImageLoaderDocuImage.java --- 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; }