Mercurial > hg > digilib-old
comparison servlet/src/digilib/image/ImageJobDescription.java @ 771:4b686a0d44f7 jquery
fixed bug ignoring ddpi parameter
| author | robcast |
|---|---|
| date | Thu, 10 Feb 2011 23:36:29 +0100 |
| parents | c1306f6d6a79 |
| children | 4568e539abd2 |
comparison
equal
deleted
inserted
replaced
| 769:7e9851ef03d7 | 771:4b686a0d44f7 |
|---|---|
| 296 float origResX = fileset.getResX(); | 296 float origResX = fileset.getResX(); |
| 297 float origResY = fileset.getResY(); | 297 float origResY = fileset.getResY(); |
| 298 if ((origResX == 0) || (origResY == 0)) { | 298 if ((origResX == 0) || (origResY == 0)) { |
| 299 throw new ImageOpException("Missing image DPI information!"); | 299 throw new ImageOpException("Missing image DPI information!"); |
| 300 } | 300 } |
| 301 if ((getAsFloat("ddpix") == 0) || (getAsFloat("ddpiy") == 0)) { | 301 float ddpix = getAsFloat("ddpix"); |
| 302 throw new ImageOpException("Missing display DPI information!"); | 302 float ddpiy = getAsFloat("ddpiy"); |
| 303 if (ddpix == 0 || ddpiy == 0) { | |
| 304 float ddpi = getAsFloat("ddpi"); | |
| 305 if (ddpi == 0) { | |
| 306 throw new ImageOpException("Missing display DPI information!"); | |
| 307 } else { | |
| 308 ddpix = ddpi; | |
| 309 ddpiy = ddpi; | |
| 310 } | |
| 303 } | 311 } |
| 304 // calculate absolute scale factor | 312 // calculate absolute scale factor |
| 305 float sx = getAsFloat("ddpix") / origResX; | 313 float sx = ddpix / origResX; |
| 306 float sy = getAsFloat("ddpiy") / origResY; | 314 float sy = ddpiy / origResY; |
| 307 // currently only same scale -- mean value | 315 // currently only same scale -- mean value |
| 308 scaleXY = (sx + sy) / 2f; | 316 scaleXY = (sx + sy) / 2f; |
| 309 } else { | 317 } else { |
| 310 scaleXY = getAsFloat("scale"); | 318 scaleXY = getAsFloat("scale"); |
| 311 } | 319 } |
