comparison servlet/src/digilib/image/ImageLoaderDocuImage.java @ 566:50f291d808b1 digilibPDF

starting stream support
author robcast
date Mon, 20 Dec 2010 11:57:55 +0100
parents 8beefd1142b2
children beeedf90cb81
comparison
equal deleted inserted replaced
565:8beefd1142b2 566:50f291d808b1
48 48
49 import digilib.io.FileOpException; 49 import digilib.io.FileOpException;
50 import digilib.io.FileOps; 50 import digilib.io.FileOps;
51 import digilib.io.ImageFile; 51 import digilib.io.ImageFile;
52 import digilib.io.ImageFileset; 52 import digilib.io.ImageFileset;
53 import digilib.io.ImageInput;
53 54
54 /** Implementation of DocuImage using the ImageLoader API of Java 1.4 and Java2D. */ 55 /** Implementation of DocuImage using the ImageLoader API of Java 1.4 and Java2D. */
55 public class ImageLoaderDocuImage extends ImageInfoDocuImage { 56 public class ImageLoaderDocuImage extends ImageInfoDocuImage {
56 57
57 /** image object */ 58 /** image object */
121 String[] formats = ImageIO.getReaderFormatNames(); 122 String[] formats = ImageIO.getReaderFormatNames();
122 return Arrays.asList(formats).iterator(); 123 return Arrays.asList(formats).iterator();
123 } 124 }
124 125
125 /** Check image size and type and store in ImageFile f */ 126 /** Check image size and type and store in ImageFile f */
126 public ImageFile identify(ImageFile imageFile) throws IOException { 127 public ImageInput identify(ImageFile imageFile) throws IOException {
127 // try parent method first 128 // try parent method first
128 ImageFile imf = super.identify(imageFile); 129 ImageInput imf = super.identify(imageFile);
129 if (imf != null) { 130 if (imf != null) {
130 return imf; 131 return imf;
131 } 132 }
132 // fileset to store the information 133 // fileset to store the information
133 ImageFileset imgfs = imageFile.getParent(); 134 ImageFileset imgfs = imageFile.getParent();