diff servlet/src/digilib/image/JAIImageLoaderDocuImage.java @ 181:afe7ff98bb71

Servlet version 1.18b1 - new transfer mode "rawfile" with mime-type application/octet-stream - finally proper logging with Log4J! - therefore a lot of debugging-prints changed - the Util class is now useless - ServletOps and FileOps are now purely static
author robcast
date Fri, 21 Nov 2003 00:17:31 +0100
parents e743b853efca
children f8c82fea551a
line wrap: on
line diff
--- a/servlet/src/digilib/image/JAIImageLoaderDocuImage.java	Fri Nov 21 00:11:18 2003 +0100
+++ b/servlet/src/digilib/image/JAIImageLoaderDocuImage.java	Fri Nov 21 00:17:31 2003 +0100
@@ -61,7 +61,7 @@
 				h = img.getHeight();
 			}
 		} catch (IOException e) {
-			e.printStackTrace();
+			logger.debug("error in getHeight", e);
 		}
 		return h;
 	}
@@ -75,7 +75,7 @@
 				w = img.getWidth();
 			}
 		} catch (IOException e) {
-			e.printStackTrace();
+			logger.debug("error in getHeight", e);
 		}
 		return w;
 	}
@@ -85,7 +85,6 @@
 		System.gc();
 		img = JAI.create("ImageRead", f.getFile().getAbsolutePath());
 		if (img == null) {
-			util.dprintln(3, "ERROR(loadImage): unable to load file");
 			throw new FileOpException("Unable to load File!");
 		}
 	}
@@ -100,7 +99,6 @@
 		reader = (ImageReader) readers.next();
 		reader.setInput(istream);
 		if (reader == null) {
-			util.dprintln(3, "ERROR(loadImage): unable to load file");
 			throw new FileOpException("Unable to load File!");
 		}
 	}
@@ -126,11 +124,9 @@
 			img = JAI.create("imageread", pb);
 			*/
 		} catch (IOException e) {
-			util.dprintln(3, "ERROR(loadImage): unable to load file");
 			throw new FileOpException("Unable to load File!");
 		}
 		if (img == null) {
-			util.dprintln(3, "ERROR(loadImage): unable to load file");
 			throw new FileOpException("Unable to load File!");
 		}
 		imgFile = f.getFile();
@@ -151,7 +147,6 @@
 				pb3.add("PNG");
 			} else {
 				// unknown mime type
-				util.dprintln(2, "ERROR(writeImage): Unknown mime type " + mt);
 				throw new FileOpException("Unknown mime type: " + mt);
 			}
 			// render output
@@ -165,7 +160,6 @@
 	 * @see java.lang.Object#finalize()
 	 */
 	protected void finalize() throws Throwable {
-		//System.out.println("FIN de JAIImageLoaderDocuImage!");
 		// we must dispose the ImageReader because it keeps the filehandle open!
 		reader.dispose();
 		reader = null;