From 5942a253cfbe22ea7a0d393b609d22934e3d1ed6 Mon Sep 17 00:00:00 2001
From: kahlep <philip.kahle@uibk.ac.at>
Date: Mon, 27 Aug 2018 09:37:57 +0200
Subject: [PATCH] #4: update twelvemonkeys iio plugin, remove other image
 readers

---
 pom.xml                                       | 15 ++++-----
 .../interfaces/types/util/ImageUtils.java     | 32 ++-----------------
 2 files changed, 9 insertions(+), 38 deletions(-)

diff --git a/pom.xml b/pom.xml
index c3b4303..3b815b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,24 +69,23 @@
 		<!-- END FOR LOGGING  -->
 		
 		<!-- Image IO stuff -->
-		<dependency>
-			<groupId>com.sun.media</groupId>
-			<artifactId>jai_imageio</artifactId>
-			<version>1.1</version>
-		</dependency>
+<!-- 		<dependency> -->
+<!-- 			<groupId>com.sun.media</groupId> -->
+<!-- 			<artifactId>jai_imageio</artifactId> -->
+<!-- 			<version>1.1</version> -->
+<!-- 		</dependency> -->
 	
 		<!-- Additional readers for jpeg and tiff -->
-		
 		<dependency>
 	        <groupId>com.twelvemonkeys.imageio</groupId>
 	        <artifactId>imageio-jpeg</artifactId>
-	        <version>3.3.2</version> 
+	        <version>3.4</version> 
 	    </dependency>
 	    
 	    <dependency>
 	        <groupId>com.twelvemonkeys.imageio</groupId>
 	        <artifactId>imageio-tiff</artifactId>
-	        <version>3.3.2</version>
+	        <version>3.4</version>
 	    </dependency>
         
 	</dependencies>
diff --git a/src/main/java/eu/transkribus/interfaces/types/util/ImageUtils.java b/src/main/java/eu/transkribus/interfaces/types/util/ImageUtils.java
index 42668ee..daf9c52 100644
--- a/src/main/java/eu/transkribus/interfaces/types/util/ImageUtils.java
+++ b/src/main/java/eu/transkribus/interfaces/types/util/ImageUtils.java
@@ -57,10 +57,10 @@ public class ImageUtils {
 	//Store instances of plugins to be registered AND unregistered. Not doing this will leave a mess in IIORegistry/Tomcat after hot (un)deployment
 	static {
 		//tiff writers
-		iioWriterList.add(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi());
+//		iioWriterList.add(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi());
 		iioWriterList.add(new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi());
 		//tiff readers
-		iioReaderList.add(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi());
+//		iioReaderList.add(new com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi());
 		iioReaderList.add(new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi());
 	}
 	
@@ -148,34 +148,6 @@ public static BufferedImage read(File f) throws IOException {
     	return bi;
     }
     
-//    public static ImageInputStream createImageInputStream(Object input) throws IOException {
-//            if (input == null) {
-//                throw new IllegalArgumentException("input == null!");
-//            }
-//
-//            Iterator<?> iter;
-//            // Ensure category is present
-//            try {
-//                iter = IIORegistry.getDefaultInstance().getServiceProviders(ImageInputStreamSpi.class,
-//                                                       true);
-//            } catch (IllegalArgumentException e) {
-//                return null;
-//            }
-//
-//            while (iter.hasNext()) {
-//                ImageInputStreamSpi spi = (ImageInputStreamSpi)iter.next();
-//                if (spi.getInputClass().isInstance(input)) {
-//                    try {
-//                        return spi.createInputStreamInstance(input);
-//                    } catch (IOException e) {
-//                        throw new IIOException("Can't create cache file!", e);
-//                    }
-//                }
-//            }
-//
-//            return null;
-//        }
-    
     /**
      * Alternative implementation of ImageIO::read.</br>
      * If one image reader claims to be able to read an ImageInputStream but fails then,