Mercurial > hg > digilib-old
changeset 853:4a3bb0888c93 stream
Merge with a29f53d8b7dd6bc0956092df253d0290bcdd894d
author | robcast |
---|---|
date | Mon, 07 Mar 2011 10:35:57 +0100 |
parents | 7718c6e832b0 (diff) a29f53d8b7dd (current diff) |
children | 1e2e9599d84c |
files | |
diffstat | 3 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/servlet/src/digilib/image/ImageJobDescription.java Fri Mar 04 18:16:28 2011 +0100 +++ b/servlet/src/digilib/image/ImageJobDescription.java Mon Mar 07 10:35:57 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 Fri Mar 04 18:16:28 2011 +0100 +++ b/servlet/src/digilib/image/ImageLoaderDocuImage.java Mon Mar 07 10:35:57 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 Fri Mar 04 18:16:28 2011 +0100 +++ b/servlet/src/digilib/servlet/Scaler.java Mon Mar 07 10:35:57 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};