changeset 771:4b686a0d44f7 jquery

fixed bug ignoring ddpi parameter
author robcast
date Thu, 10 Feb 2011 23:36:29 +0100
parents 7e9851ef03d7
children 33b5477f8d84
files servlet/src/digilib/image/ImageJobDescription.java
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/image/ImageJobDescription.java	Thu Feb 10 21:13:54 2011 +0100
+++ b/servlet/src/digilib/image/ImageJobDescription.java	Thu Feb 10 23:36:29 2011 +0100
@@ -298,12 +298,20 @@
 					if ((origResX == 0) || (origResY == 0)) {
 						throw new ImageOpException("Missing image DPI information!");
 					}
-					if ((getAsFloat("ddpix") == 0) || (getAsFloat("ddpiy") == 0)) {
-						throw new ImageOpException("Missing display DPI information!");
+					float ddpix = getAsFloat("ddpix");
+                    float ddpiy = getAsFloat("ddpiy");
+					if (ddpix == 0 || ddpiy == 0) {
+					    float ddpi = getAsFloat("ddpi");
+					    if (ddpi == 0) {
+					        throw new ImageOpException("Missing display DPI information!");
+					    } else {
+					        ddpix = ddpi;
+					        ddpiy = ddpi;
+					    }
 					}
 					// calculate absolute scale factor
-					float sx = getAsFloat("ddpix") / origResX;
-					float sy = getAsFloat("ddpiy") / origResY;
+					float sx = ddpix / origResX;
+					float sy = ddpiy / origResY;
 					// currently only same scale -- mean value
 					scaleXY = (sx + sy) / 2f;
 				} else {