changeset 1422:9d3e5b4453fd new_scaling

improved IIIF compliance.
author robcast
date Mon, 26 Oct 2015 21:29:19 +0100
parents 8a713bc0e86f
children 75ec39abcbba
files common/src/main/java/digilib/image/ImageJobDescription.java servlet/pom.xml servlet/src/main/java/digilib/servlet/ServletOps.java webapp/pom.xml webapp/src/main/webapp/WEB-INF/web-2.3.xml webapp/src/main/webapp/WEB-INF/web-2.4.xml
diffstat 6 files changed, 54 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/common/src/main/java/digilib/image/ImageJobDescription.java	Mon Oct 26 20:22:51 2015 +0100
+++ b/common/src/main/java/digilib/image/ImageJobDescription.java	Mon Oct 26 21:29:19 2015 +0100
@@ -866,6 +866,8 @@
             imageSendable = (mimeType != null
             		// input image is browser compatible
                     && (mimeType.equals("image/jpeg") || mimeType.equals("image/png") || mimeType.equals("image/gif"))
+                    // no forced type conversion
+                    && !(hasOption("jpg") || hasOption("png"))
                     // no zooming
                     && !(getWx() > 0f || getWy() > 0f || getWw() < 1f || getWh() < 1f
                     // no other image operations
--- a/servlet/pom.xml	Mon Oct 26 20:22:51 2015 +0100
+++ b/servlet/pom.xml	Mon Oct 26 21:29:19 2015 +0100
@@ -22,7 +22,7 @@
   	<dependency>
   		<groupId>javax.servlet</groupId>
   		<artifactId>servlet-api</artifactId>
-  		<version>2.3</version>
+  		<version>2.4</version>
   		<type>jar</type>
   		<scope>provided</scope>
   	</dependency>
--- a/servlet/src/main/java/digilib/servlet/ServletOps.java	Mon Oct 26 20:22:51 2015 +0100
+++ b/servlet/src/main/java/digilib/servlet/ServletOps.java	Mon Oct 26 21:29:19 2015 +0100
@@ -383,7 +383,8 @@
         } else if (url.endsWith("/")) {
             url = url.substring(0, url.lastIndexOf("/"));
         }
-        response.setContentType("application/json;charset=UTF-8");
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/json,application/ld+json");
         PrintWriter writer;
         try {
             writer = response.getWriter();
--- a/webapp/pom.xml	Mon Oct 26 20:22:51 2015 +0100
+++ b/webapp/pom.xml	Mon Oct 26 21:29:19 2015 +0100
@@ -63,7 +63,7 @@
 						<groupId>org.apache.maven.plugins</groupId>
 						<artifactId>maven-war-plugin</artifactId>
 						<configuration>
-							<webXml>${basedir}/src/main/webapp/WEB-INF/web-2.3.xml</webXml>
+							<webXml>${basedir}/src/main/webapp/WEB-INF/web-2.4.xml</webXml>
 							<classifier>srv2</classifier>
 						</configuration>
 					</plugin>
--- a/webapp/src/main/webapp/WEB-INF/web-2.3.xml	Mon Oct 26 20:22:51 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
- 
-<web-app>
-  <!-- General description of your web application -->
-  <display-name>
-        digilib
-  </display-name>
-  <description>
-        This is the web frontend of the Digital Document Library.
-  </description>
-  <!-- The Intialisation Listener -->
-  <listener>
-        <listener-class>
-            digilib.conf.DigilibServletConfiguration
-        </listener-class>
-  </listener>
-  <!-- The Scaler servlet -->
-  <servlet>
-        <servlet-name>
-            Scaler
-        </servlet-name>
-        <servlet-class>
-            digilib.servlet.Scaler
-        </servlet-class>
-        <!-- Load this servlet at server startup time -->
-        <load-on-startup>
-            5
-        </load-on-startup>
-  </servlet>
-  <!-- The mapping for the Scaler servlet -->
-  <servlet-mapping>
-        <servlet-name>
-            Scaler
-        </servlet-name>
-        <url-pattern>
-            /servlet/Scaler/*
-        </url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-        <servlet-name>
-            Scaler
-        </servlet-name>
-        <url-pattern>
-            /Scaler/*
-        </url-pattern>
-  </servlet-mapping>
-</web-app>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webapp/src/main/webapp/WEB-INF/web-2.4.xml	Mon Oct 26 21:29:19 2015 +0100
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+ 
+<web-app>
+  <!-- General description of your web application -->
+  <display-name>
+        digilib
+  </display-name>
+  <description>
+        This is the web frontend of the Digital Document Library.
+  </description>
+  <!-- The Intialisation Listener -->
+  <listener>
+        <listener-class>
+            digilib.conf.DigilibServletConfiguration
+        </listener-class>
+  </listener>
+  <!-- The Scaler servlet -->
+  <servlet>
+        <servlet-name>
+            Scaler
+        </servlet-name>
+        <servlet-class>
+            digilib.servlet.Scaler
+        </servlet-class>
+        <!-- Load this servlet at server startup time -->
+        <load-on-startup>
+            5
+        </load-on-startup>
+  </servlet>
+  <!-- The mapping for the Scaler servlet -->
+  <servlet-mapping>
+        <servlet-name>
+            Scaler
+        </servlet-name>
+        <url-pattern>
+            /servlet/Scaler/*
+        </url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+        <servlet-name>
+            Scaler
+        </servlet-name>
+        <url-pattern>
+            /Scaler/*
+        </url-pattern>
+  </servlet-mapping>
+</web-app>