Mercurial > hg > digilib-old
comparison servlet/src/digilib/image/DocuImageImpl.java @ 464:f1f710ff14ad
Servlet version 1.10b
- JAIDocuImage loads Flashpix
- refactored image detection code into DocuImage
- DocuImage has new methods identify() and getSupportedFormats()
author | robcast |
---|---|
date | Mon, 13 Feb 2006 20:57:18 +0100 |
parents | 03ff7238c9d4 |
children | 11e11fe4d680 |
comparison
equal
deleted
inserted
replaced
463:d76a9e3f1ec9 | 464:f1f710ff14ad |
---|---|
18 | 18 |
19 */ | 19 */ |
20 | 20 |
21 package digilib.image; | 21 package digilib.image; |
22 | 22 |
23 import digilib.io.ImageFileset; | |
24 import java.awt.Rectangle; | 23 import java.awt.Rectangle; |
25 import java.io.File; | 24 import java.io.File; |
26 import java.io.IOException; | 25 import java.io.IOException; |
27 import java.io.RandomAccessFile; | 26 import java.io.RandomAccessFile; |
27 import java.util.Iterator; | |
28 import java.util.LinkedList; | |
29 import java.util.List; | |
28 | 30 |
29 import org.apache.log4j.Logger; | 31 import org.apache.log4j.Logger; |
32 import org.marcoschmidt.image.ImageInfo; | |
30 | 33 |
31 import digilib.io.FileOpException; | 34 import digilib.io.FileOpException; |
32 import digilib.io.ImageFile; | 35 import digilib.io.ImageFile; |
33 import org.marcoschmidt.image.ImageInfo; | |
34 | 36 |
35 /** Simple abstract implementation of the <code>DocuImage</code> interface. | 37 /** Simple abstract implementation of the <code>DocuImage</code> interface. |
36 * | 38 * |
37 * This implementation provides basic functionality for the utility methods like | 39 * This implementation provides basic functionality for the utility methods like |
38 * <code>SetUtils</code>, and <code>getKnownFileTypes</code>. Image methods like | 40 * <code>SetUtils</code>, and <code>getKnownFileTypes</code>. Image methods like |
71 } | 73 } |
72 | 74 |
73 /** Check image size and type and store in ImageFile f */ | 75 /** Check image size and type and store in ImageFile f */ |
74 public boolean identify(ImageFile imgf) throws IOException { | 76 public boolean identify(ImageFile imgf) throws IOException { |
75 // fileset to store the information | 77 // fileset to store the information |
76 ImageFileset imgfs = imgf.getParent(); | |
77 File f = imgf.getFile(); | 78 File f = imgf.getFile(); |
78 if (f == null) { | 79 if (f == null) { |
79 throw new IOException("File not found!"); | 80 throw new IOException("File not found!"); |
80 } | 81 } |
81 RandomAccessFile raf = new RandomAccessFile(f, "r"); | 82 RandomAccessFile raf = new RandomAccessFile(f, "r"); |
151 throws ImageOpException { | 152 throws ImageOpException { |
152 // emtpy implementation | 153 // emtpy implementation |
153 } | 154 } |
154 | 155 |
155 public void dispose() { | 156 public void dispose() { |
157 // emtpy implementation | |
158 } | |
159 | |
160 public Iterator getSupportedFormats() { | |
161 List empty = new LinkedList(); | |
162 return empty.iterator(); | |
156 } | 163 } |
157 | 164 |
158 } | 165 } |