Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
#4: update twelvemonkeys iio plugin, remove other image readers
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlep committed Aug 27, 2018
1 parent cf3664c commit 5942a25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
32 changes: 2 additions & 30 deletions src/main/java/eu/transkribus/interfaces/types/util/ImageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5942a25

Please sign in to comment.