# HG changeset patch # User hertzhaft # Date 1133891597 -3600 # Node ID b37d2737b342b19df2d839ff7889239fec43ea48 # Parent 7b189f1b8954e792941ca977b27153a07085f348 added code for "not found" image diff -r 7b189f1b8954 -r b37d2737b342 servlet/src/digilib/servlet/Scaler.java --- a/servlet/src/digilib/servlet/Scaler.java Tue Dec 06 18:52:18 2005 +0100 +++ b/servlet/src/digilib/servlet/Scaler.java Tue Dec 06 18:53:17 2005 +0100 @@ -59,7 +59,7 @@ private static final long serialVersionUID = -325080527268912852L; /** digilib servlet version (for all components) */ - public static final String dlVersion = "1.5.9e"; + public static final String dlVersion = "1.5.9f"; /** logger for accounting requests */ private static Logger accountlog = Logger.getLogger("account.request"); @@ -91,6 +91,9 @@ /** image error image file */ File errorImgFile; + /** not found error image file */ + File notfoundImgFile; + /** subsampling before scaling */ float minSubsample = 2f; @@ -146,6 +149,7 @@ dirCache = (DocuDirCache) dlConfig.getValue("servlet.dir.cache"); denyImgFile = (File) dlConfig.getValue("denied-image"); errorImgFile = (File) dlConfig.getValue("error-image"); + notfoundImgFile = (File) dlConfig.getValue("notfound-image"); sendFileAllowed = dlConfig.getAsBoolean("sendfile-allowed"); minSubsample = dlConfig.getAsFloat("subsample-minimum"); defaultQuality = dlConfig.getAsInt("default-quality"); @@ -702,6 +706,11 @@ msg = "ERROR: Unauthorized access!"; } img = denyImgFile; + } else if (type == ERROR_FILE) { + if (msg == null) { + msg = "ERROR: Image file not found!"; + } + img = notfoundImgFile; } else { if (msg == null) { msg = "ERROR: Other image error!";