Mercurial > hg > digilib-old
comparison servlet/src/digilib/servlet/Scaler.java @ 139:11cfe4c89fdc
Servlet version 1.11b1 with improved original-size.
- fixed lots of bugs in metadata handling.
author | robcast |
---|---|
date | Thu, 31 Jul 2003 20:56:51 +0200 |
parents | c36944be0b58 |
children | c878ea574c29 |
comparison
equal
deleted
inserted
replaced
138:d18b0ff52b07 | 139:11cfe4c89fdc |
---|---|
56 */ | 56 */ |
57 //public class Scaler extends HttpServlet implements SingleThreadModel { | 57 //public class Scaler extends HttpServlet implements SingleThreadModel { |
58 public class Scaler extends HttpServlet { | 58 public class Scaler extends HttpServlet { |
59 | 59 |
60 // digilib servlet version (for all components) | 60 // digilib servlet version (for all components) |
61 public static final String dlVersion = "1.11a1"; | 61 public static final String dlVersion = "1.11b1"; |
62 | 62 |
63 // Utils instance with debuglevel | 63 // Utils instance with debuglevel |
64 Utils util; | 64 Utils util; |
65 // FileOps instance | 65 // FileOps instance |
66 FileOps fileOp; | 66 FileOps fileOp; |
399 if (absoluteScale) { | 399 if (absoluteScale) { |
400 // get original resolution from metadata | 400 // get original resolution from metadata |
401 fileset.checkMeta(); | 401 fileset.checkMeta(); |
402 origResX = fileset.getResX(); | 402 origResX = fileset.getResX(); |
403 origResY = fileset.getResY(); | 403 origResY = fileset.getResY(); |
404 if ((origResX == 0) || (origResY == 0)) { | |
405 throw new ImageOpException("Missing image DPI information!"); | |
406 } | |
407 | |
408 if ((paramDDPIX == 0) || (paramDDPIY == 0)) { | |
409 throw new ImageOpException("Missing display DPI information!"); | |
410 } | |
404 } | 411 } |
405 | 412 |
406 // check the source image | 413 // check the source image |
407 if (!fileToLoad.isChecked()) { | 414 if (!fileToLoad.isChecked()) { |
408 fileToLoad.check(docuInfo); | 415 fileToLoad.check(docuInfo); |
420 || (paramROT != 0) | 427 || (paramROT != 0) |
421 || (paramRGBM != null) | 428 || (paramRGBM != null) |
422 || (paramRGBA != null) | 429 || (paramRGBA != null) |
423 || (paramCONT != 0) | 430 || (paramCONT != 0) |
424 || (paramBRGT != 0); | 431 || (paramBRGT != 0); |
425 boolean imageSendable = mimetypeSendable && ! imagoOptions; | 432 boolean imageSendable = mimetypeSendable && !imagoOptions; |
426 | 433 |
427 /* if not autoRes and image smaller than requested | 434 /* if not autoRes and image smaller than requested |
428 * size then send as is. | 435 * size then send as is. |
429 * if not autoScale and not scaleToFit nor cropToFit | 436 * if not autoScale and not scaleToFit nor cropToFit |
430 * then send as is (mo=file) | 437 * then send as is (mo=file) |