changeset 1425:d4cfce3887f0

send file not found error instead of NPE if the codec can't read the image file.
author robcast
date Tue, 27 Oct 2015 18:12:40 +0100
parents 21da78f0a267
children 69087d665d96
files common/src/main/java/digilib/image/ImageJobDescription.java common/src/main/java/digilib/image/ImageLoaderDocuImage.java
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/common/src/main/java/digilib/image/ImageJobDescription.java	Tue Oct 27 11:23:30 2015 +0100
+++ b/common/src/main/java/digilib/image/ImageJobDescription.java	Tue Oct 27 18:12:40 2015 +0100
@@ -585,6 +585,9 @@
 	        ImageSet fileset = getImageSet();
 	        ImageInput hiresFile = fileset.getBiggest();
 	        hiresSize = hiresFile.getSize();
+	        if (hiresSize == null) {
+	        	throw new FileOpException("Can't get size from hires image file!");
+	        }
         }
         return hiresSize;
     }
--- a/common/src/main/java/digilib/image/ImageLoaderDocuImage.java	Tue Oct 27 11:23:30 2015 +0100
+++ b/common/src/main/java/digilib/image/ImageLoaderDocuImage.java	Tue Oct 27 18:12:40 2015 +0100
@@ -274,7 +274,7 @@
             return input;
         } catch (FileOpException e) {
             // maybe just our class doesn't know what to do
-            logger.error("ImageLoaderDocuimage unable to identify:", e);
+            logger.error("ImageLoaderDocuimage unable to identify: "+e);
             return null;
         } finally {
             if (!reuseReader && reader != null) {