From: Svjatoslav Agejenko Date: Sat, 4 Apr 2020 11:36:46 +0000 (+0300) Subject: Use OpenIMAJ for loading images because Java standard library is buggy X-Git-Tag: meviz-1.2~9 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=meviz.git;a=commitdiff_plain;h=765070ae89592886c7c82c8c3f4e2466a5a17c04 Use OpenIMAJ for loading images because Java standard library is buggy --- diff --git a/pom.xml b/pom.xml index 9ad5714..9ca1fcf 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,11 @@ tika-core 1.18 + + org.openimaj + core-image + 1.3.5 + diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java index ba0d23c..172ec44 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java @@ -28,7 +28,8 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.zip.CRC32; -import static javax.imageio.ImageIO.read; +import static org.openimaj.image.ImageUtilities.createBufferedImage; +import static org.openimaj.image.ImageUtilities.readMBF; public class Utils { private static File lastLoadedFile; @@ -46,8 +47,7 @@ public class Utils { if (file.equals(lastLoadedFile)) return lastLoadedBufferedImage; - System.out.println("Loading image: " + file.getPath()); - lastLoadedBufferedImage = read(file); + lastLoadedBufferedImage = createBufferedImage(readMBF(file)); lastLoadedFile = file; if (lastLoadedBufferedImage == null) {