# HG changeset patch # User robcast # Date 1298452193 -3600 # Node ID 26a3e127f45c5df5d74dfef6a493762afd5e905a # Parent 6c752969f9e8961fb7ec81b9c7b91152eac1cd59 config option img-diskcache-allowed to switch off disk caching in ImageIO diff -r 6c752969f9e8 -r 26a3e127f45c client/digitallibrary/WEB-INF/digilib-config.xml --- a/client/digitallibrary/WEB-INF/digilib-config.xml Tue Feb 22 20:08:27 2011 +0100 +++ b/client/digitallibrary/WEB-INF/digilib-config.xml Wed Feb 23 10:09:53 2011 +0100 @@ -68,5 +68,7 @@ + + diff -r 6c752969f9e8 -r 26a3e127f45c servlet/src/digilib/servlet/DigilibConfiguration.java --- a/servlet/src/digilib/servlet/DigilibConfiguration.java Tue Feb 22 20:08:27 2011 +0100 +++ b/servlet/src/digilib/servlet/DigilibConfiguration.java Wed Feb 23 10:09:53 2011 +0100 @@ -26,7 +26,6 @@ import java.util.Map; import java.util.Map.Entry; -import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -173,8 +172,8 @@ newParameter("pdf-temp-dir", "pdf_temp", null, 'f'); // PDF generation cache directory newParameter("pdf-cache-dir", "pdf_cache", null, 'f'); - // PDF generation cache directory - newParameter("pdf-cache-dir", "pdf_cache", null, 'f'); + // allow image toolkit to use disk cache + newParameter("img-diskcache-allowed", Boolean.TRUE, null, 'f'); } /** diff -r 6c752969f9e8 -r 26a3e127f45c servlet/src/digilib/servlet/Initialiser.java --- a/servlet/src/digilib/servlet/Initialiser.java Tue Feb 22 20:08:27 2011 +0100 +++ b/servlet/src/digilib/servlet/Initialiser.java Wed Feb 23 10:09:53 2011 +0100 @@ -24,6 +24,7 @@ import java.io.OutputStream; import java.util.List; +import javax.imageio.ImageIO; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; @@ -129,6 +130,10 @@ // DocuImage class DocuImage di = DigilibConfiguration.getDocuImageInstance(); dlConfig.setValue("servlet.docuimage.class", di.getClass().getName()); + // disk cache for image toolkit + boolean dc = dlConfig.getAsBoolean("img-diskcache-allowed"); + // TODO: methods for all toolkits? + ImageIO.setUseCache(dc); // digilib worker threads int nt = dlConfig.getAsInt("worker-threads"); int mt = dlConfig.getAsInt("max-waiting-threads"); diff -r 6c752969f9e8 -r 26a3e127f45c servlet/src/digilib/servlet/Scaler.java --- a/servlet/src/digilib/servlet/Scaler.java Tue Feb 22 20:08:27 2011 +0100 +++ b/servlet/src/digilib/servlet/Scaler.java Wed Feb 23 10:09:53 2011 +0100 @@ -31,7 +31,7 @@ private static final long serialVersionUID = 5289386646192471549L; /** digilib servlet version (for all components) */ - public static final String version = "1.9.1a9"; + public static final String version = "1.9.1a10"; /** servlet error codes */ public static enum Error {UNKNOWN, AUTH, FILE, IMAGE};