changeset 912:cbfc94584d3b

reset imgSize in operations that change size.
author robcast
date Wed, 08 Jun 2011 17:49:01 +0200
parents 0cea7e608080
children ad071f122164
files common/src/main/java/digilib/image/ImageLoaderDocuImage.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/common/src/main/java/digilib/image/ImageLoaderDocuImage.java	Tue May 24 13:48:37 2011 -0400
+++ b/common/src/main/java/digilib/image/ImageLoaderDocuImage.java	Wed Jun 08 17:49:01 2011 +0200
@@ -329,6 +329,8 @@
 			logger.debug("loading..");
 			img = reader.read(0, readParam);
 			logger.debug("loaded");
+			// invalidate image size
+			imageSize = null;
 			/* downconversion of highcolor images seems not to work
 	        if (img.getColorModel().getComponentSize(0) > 8) {
 	            logger.debug("converting to 8bit");
@@ -414,6 +416,8 @@
         img = scaleOp.filter(img, null);
         logger.debug("scaled to " + img.getWidth() + "x" + img.getHeight()
                 + " img=" + img);
+        // invalidate image size
+        imageSize = null;
     }
 
 	public void blur(int radius) throws ImageOpException {
@@ -454,6 +458,8 @@
 		img = img.getSubimage(x_off, y_off, width, height);
 		logger.debug("CROP:" + img.getWidth() + "x"
 				+ img.getHeight());
+        // invalidate image size
+        imageSize = null;
 	}
 
 	public void rotate(double angle) throws ImageOpException {
@@ -480,6 +486,8 @@
 		// transform image
 		img = rotOp.filter(img, null);
 		logger.debug("rotated: "+img);
+        // invalidate image size
+        imageSize = null;
 	}
 
 	public void mirror(double angle) throws ImageOpException {
@@ -511,6 +519,8 @@
 		AffineTransformOp mirOp = new AffineTransformOp(new AffineTransform(mx,
 				0, 0, my, tx, ty), renderHint);
 		img = mirOp.filter(img, null);
+        // invalidate image size
+        imageSize = null;
 	}
 
     public void enhance(float mult, float add) throws ImageOpException {