changeset 843:7718c6e832b0 stream

enhance (cont, brgt) operation now with just one float. crashes linux jdk sometimes :-(
author robcast
date Fri, 04 Mar 2011 10:19:46 +0100
parents ba449162d77f
children 4a3bb0888c93
files servlet/src/digilib/image/ImageJobDescription.java servlet/src/digilib/image/ImageLoaderDocuImage.java servlet/src/digilib/servlet/Scaler.java
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/image/ImageJobDescription.java	Thu Mar 03 17:51:54 2011 +0100
+++ b/servlet/src/digilib/image/ImageJobDescription.java	Fri Mar 04 10:19:46 2011 +0100
@@ -432,6 +432,9 @@
 
 	public ColorOp getColOp() {
 		String op = getAsString("colop");
+		if (op == null || op.length() == 0) {
+			return null;
+		}
 		try {
 			return ColorOp.valueOf(op.toUpperCase());
 		} catch (Exception e) {
--- a/servlet/src/digilib/image/ImageLoaderDocuImage.java	Thu Mar 03 17:51:54 2011 +0100
+++ b/servlet/src/digilib/image/ImageLoaderDocuImage.java	Fri Mar 04 10:19:46 2011 +0100
@@ -429,6 +429,9 @@
 	}
 
 	public void enhance(float mult, float add) throws ImageOpException {
+		RescaleOp op = null;
+		logger.debug("enhance: cm="+img.getColorModel());
+		op = new RescaleOp(mult, add, renderHint);
 		/*
 		 * Only one constant should work regardless of the number of bands
 		 * according to the JDK spec. Doesn't work on JDK 1.4 for OSX and Linux
@@ -436,7 +439,7 @@
 		 * (float)add, null); scaleOp.filter(img, img);
 		 */
 
-		/* The number of constants must match the number of bands in the image. */
+		/* The number of constants must match the number of bands in the image.
 		int ncol = img.getColorModel().getNumComponents();
 		float[] dm = new float[ncol];
 		float[] da = new float[ncol];
@@ -444,8 +447,8 @@
 			dm[i] = (float) mult;
 			da[i] = (float) add;
 		}
-		RescaleOp scaleOp = new RescaleOp(dm, da, null);
-		scaleOp.filter(img, img);
+		RescaleOp scaleOp = new RescaleOp(dm, da, null); */
+		op.filter(img, img);
 	}
 
 	public void enhanceRGB(float[] rgbm, float[] rgba) throws ImageOpException {
--- a/servlet/src/digilib/servlet/Scaler.java	Thu Mar 03 17:51:54 2011 +0100
+++ b/servlet/src/digilib/servlet/Scaler.java	Fri Mar 04 10:19:46 2011 +0100
@@ -31,7 +31,7 @@
     private static final long serialVersionUID = 5289386646192471549L;
 
     /** digilib servlet version (for all components) */
-    public static final String version = "1.9.1a17";
+    public static final String version = "1.9.1a18";
 
     /** servlet error codes */
     public static enum Error {UNKNOWN, AUTH, FILE, IMAGE};