changeset 394:31643c12d939

digilib can now take its error-icons from the web app
author robcast
date Wed, 07 Dec 2005 19:06:32 +0100
parents 8a9fd4d64ea7
children 6d6f2595cfe6
files servlet/src/digilib/servlet/DigilibConfiguration.java servlet/src/digilib/servlet/Scaler.java
diffstat 2 files changed, 7 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/digilib/servlet/DigilibConfiguration.java	Wed Dec 07 19:06:31 2005 +0100
+++ b/servlet/src/digilib/servlet/DigilibConfiguration.java	Wed Dec 07 19:06:32 2005 +0100
@@ -99,19 +99,19 @@
 		// image file to send in case of error
 		newParameter(
 			"error-image",
-			new File("/docuserver/images/icons/digilib-error.png"),
+			new File("img/digilib-error.png"),
 			null,
 			'f');
 		// image file to send if access is denied
 		newParameter(
 			"denied-image",
-			new File("/docuserver/images/icons/digilib-denied.png"),
+			new File("img/digilib-denied.png"),
 			null,
 			'f');
 		// image file to send if image file not found
 		newParameter(
 			"notfound-image",
-			new File("/docuserver/images/icons/digilib-notfound.png"),
+			new File("img/digilib-notfound.png"),
 			null,
 			'f');
 		// base directories in order of preference (prescaled versions last)
--- a/servlet/src/digilib/servlet/Scaler.java	Wed Dec 07 19:06:31 2005 +0100
+++ b/servlet/src/digilib/servlet/Scaler.java	Wed Dec 07 19:06:32 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.9f";
+	public static final String dlVersion = "1.5.9g";
 
 	/** logger for accounting requests */
 	private static Logger accountlog = Logger.getLogger("account.request");
@@ -147,9 +147,9 @@
 
 		// DocuDirCache instance
 		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");
+		denyImgFile = ServletOps.getFile((File) dlConfig.getValue("denied-image"), config);
+		errorImgFile = ServletOps.getFile((File) dlConfig.getValue("error-image"), config);
+		notfoundImgFile = ServletOps.getFile((File) dlConfig.getValue("notfound-image"), config);
 		sendFileAllowed = dlConfig.getAsBoolean("sendfile-allowed");
 		minSubsample = dlConfig.getAsFloat("subsample-minimum");
 		defaultQuality = dlConfig.getAsInt("default-quality");
@@ -227,10 +227,6 @@
 		boolean scaleToFit = true;
 		// scale the image by a fixed factor only
 		boolean absoluteScale = false;
-		// only crop the image to fit
-		boolean cropToFit = false;
-		// send the file as is
-		boolean sendFile = false;
 		// use low resolution images only
 		boolean loresOnly = false;
 		// use hires images only
@@ -241,10 +237,6 @@
 		int scaleQual = defaultQuality;
 		// send html error message (or image file)
 		boolean errorMsgHtml = false;
-		// mirror the image
-		boolean doMirror = false;
-		// angle of mirror axis
-		float mirrorAngle = 0;
 		// original (hires) image resolution
 		float origResX = 0;
 		float origResY = 0;
@@ -301,20 +293,14 @@
 		if (dlRequest.hasOption("mo", "clip")) {
 			scaleToFit = false;
 			absoluteScale = false;
-			cropToFit = true;
-			sendFile = false;
 			hiresOnly = true;
 		} else if (dlRequest.hasOption("mo", "fit")) {
 			scaleToFit = true;
 			absoluteScale = false;
-			cropToFit = false;
-			sendFile = false;
 			hiresOnly = false;
 		} else if (dlRequest.hasOption("mo", "osize")) {
 			scaleToFit = false;
 			absoluteScale = true;
-			cropToFit = false;
-			sendFile = false;
 			hiresOnly = true;
 		}
 		// operation mode: "lores": try to use scaled image, "hires": use
@@ -543,8 +529,6 @@
 					+ "ms");
 
 			// coordinates and scaling
-			float areaXoff;
-			float areaYoff;
 			float areaWidth;
 			float areaHeight;
 			float scaleX;