Mercurial > hg > digilib
diff servlet/src/digilib/image/ImageJobDescription.java @ 767:292b2948533f stream
merge from jquery branch
19754e80cc9fb019a073b61891415233b4ef591a
author | robcast |
---|---|
date | Fri, 11 Feb 2011 10:12:41 +0100 |
parents | ecb6a9a04abd 397f1168628c |
children | 047bcb651080 |
line wrap: on
line diff
--- a/servlet/src/digilib/image/ImageJobDescription.java Tue Feb 08 22:49:44 2011 +0100 +++ b/servlet/src/digilib/image/ImageJobDescription.java Fri Feb 11 10:12:41 2011 +0100 @@ -317,12 +317,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 {