comparison servlet/src/digilib/image/ImageWorker.java @ 576:dad720e9b12b stream

try: DocuDirent as interface, ImageFile inherits from ImageInput and implements DocuDirent
author robcast
date Wed, 22 Dec 2010 20:19:06 +0100
parents fd2ef7e46119
children aee436f0549d
comparison
equal deleted inserted replaced
574:790cbfb58b52 576:dad720e9b12b
8 import java.util.concurrent.Callable; 8 import java.util.concurrent.Callable;
9 9
10 import org.apache.log4j.Logger; 10 import org.apache.log4j.Logger;
11 11
12 import digilib.io.FileOpException; 12 import digilib.io.FileOpException;
13 import digilib.io.ImageFile;
13 import digilib.servlet.DigilibConfiguration; 14 import digilib.servlet.DigilibConfiguration;
14 15
15 /** Worker that renders an image. 16 /** Worker that renders an image.
16 * 17 *
17 * @author casties 18 * @author casties
68 scaleXY = subsamp / subf; 69 scaleXY = subsamp / subf;
69 logger.debug("Using subsampling: " + subsamp + " rest " 70 logger.debug("Using subsampling: " + subsamp + " rest "
70 + scaleXY); 71 + scaleXY);
71 } 72 }
72 73
73 docuImage.loadSubimage(jobinfo.getFileToLoad(), loadRect, (int) subsamp); 74 docuImage.loadSubimage((ImageFile) jobinfo.getFileToLoad(), loadRect, (int) subsamp); //FIXME: cast to file
74 75
75 logger.debug("SUBSAMP: " + subsamp + " -> " + docuImage.getSize()); 76 logger.debug("SUBSAMP: " + subsamp + " -> " + docuImage.getSize());
76 77
77 docuImage.scale(scaleXY, scaleXY); 78 docuImage.scale(scaleXY, scaleXY);
78 79
79 } else { 80 } else {
80 // else load and crop the whole file 81 // else load and crop the whole file
81 docuImage.loadImage(jobinfo.getFileToLoad()); 82 docuImage.loadImage((ImageFile) jobinfo.getFileToLoad()); //FIXME: cast to file
82 docuImage.crop((int) loadRect.getX(), (int) loadRect.getY(), 83 docuImage.crop((int) loadRect.getX(), (int) loadRect.getY(),
83 (int) loadRect.getWidth(), (int) loadRect.getHeight()); 84 (int) loadRect.getWidth(), (int) loadRect.getHeight());
84 85
85 docuImage.scale(scaleXY, scaleXY); 86 docuImage.scale(scaleXY, scaleXY);
86 } 87 }