Mercurial > hg > digilib-old
changeset 363:b37d2737b342
added code for "not found" image
author | hertzhaft |
---|---|
date | Tue, 06 Dec 2005 18:53:17 +0100 |
parents | 7b189f1b8954 |
children | 0ceff128d592 |
files | servlet/src/digilib/servlet/Scaler.java |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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!";