changeset 581:bb8dfc05674f stream

more ripping apart ImageFileSet
author robcast
date Thu, 23 Dec 2010 19:04:57 +0100
parents 50bd3d9759f3
children c7034d166a24
files servlet/src/digilib/io/ImageFileSet.java servlet/src/digilib/io/ImageInput.java servlet/src/digilib/io/ImageSet.java
diffstat 3 files changed, 15 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/io/ImageFileSet.java	Wed Dec 22 20:39:09 2010 +0100
+++ b/servlet/src/digilib/io/ImageFileSet.java	Thu Dec 23 19:04:57 2010 +0100
@@ -18,9 +18,14 @@
 
     /** this is an image file */
     protected static FileClass fileClass = FileClass.IMAGE;
-    private Directory parent;
-    private boolean metaChecked;
-    private Map fileMeta;
+    /** the file name */
+    protected String filename = null;
+	/** HashMap with metadata */
+	protected MetadataMap fileMeta = null;
+	/** Is the Metadata valid */
+	protected boolean metaChecked = false;
+	/** the parent directory */
+	protected Directory parent = null;
     
     /**
      * Constructor with a file and hints.
--- a/servlet/src/digilib/io/ImageInput.java	Wed Dec 22 20:39:09 2010 +0100
+++ b/servlet/src/digilib/io/ImageInput.java	Thu Dec 23 19:04:57 2010 +0100
@@ -61,7 +61,8 @@
 	}
 
 	/** returns if this image has been checked 
-	 * (i.e. has size and mimetype) 
+	 * (i.e. has size and mimetype)
+	 * TODO: deprecated
 	 * @return boolean
 	 */
 	public boolean isChecked() {
--- a/servlet/src/digilib/io/ImageSet.java	Wed Dec 22 20:39:09 2010 +0100
+++ b/servlet/src/digilib/io/ImageSet.java	Thu Dec 23 19:04:57 2010 +0100
@@ -17,13 +17,11 @@
 
 package digilib.io;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
 
 import digilib.image.ImageSize;
-import digilib.servlet.DigilibConfiguration;
 
 /**
  * @author casties
@@ -86,8 +84,6 @@
 	 * 
 	 * Returns the ImageFile from the set that has a width and height smaller or
 	 * equal the given size. Returns null if there isn't any smaller image.
-	 * Needs DocuInfo instance to checkFile().
-	 * 
 	 * 
 	 * @param size
 	 * @param info
@@ -96,14 +92,8 @@
 	public ImageInput getNextSmaller(ImageSize size) {
 		for (ListIterator<ImageInput> i = getHiresIterator(); i.hasNext();) {
 			ImageInput f = i.next();
-			try {
-				if (!f.isChecked()) {
-					DigilibConfiguration.docuImageIdentify((ImageFile) f); // FIXME: cast to file?
-				}
-				if (f.getSize().isTotallySmallerThan(size)) {
-					return f;
-				}
-			} catch (IOException e) {
+			if (f.getSize().isTotallySmallerThan(size)) {
+				return f;
 			}
 		}
 		return null;
@@ -113,9 +103,7 @@
 	 * Get the next bigger ImageFile than the given size.
 	 * 
 	 * Returns the ImageFile from the set that has a width or height bigger or
-	 * equal the given size. Returns null if there isn't any bigger image. Needs
-	 * DocuInfo instance to checkFile().
-	 * 
+	 * equal the given size. Returns null if there isn't any bigger image.
 	 * 
 	 * @param size
 	 * @param info
@@ -124,14 +112,8 @@
 	public ImageInput getNextBigger(ImageSize size) {
 		for (ListIterator<ImageInput> i = getLoresIterator(); i.hasPrevious();) {
 			ImageInput f = i.previous();
-			try {
-				if (!f.isChecked()) {
-					DigilibConfiguration.docuImageIdentify((ImageFile) f); // FIXME: cast to file?
-				}
-				if (f.getSize().isBiggerThan(size)) {
-					return f;
-				}
-			} catch (IOException e) {
+			if (f.getSize().isBiggerThan(size)) {
+				return f;
 			}
 		}
 		return null;