add JPEG2000 image i/o

This commit is contained in:
Jörg Prante 2024-02-19 16:01:17 +01:00
parent b906e7533b
commit 047fee7798
5 changed files with 34 additions and 8 deletions

View file

@ -1,3 +1,3 @@
group = org.xbib.graphics
name = graphics
version = 5.3.4
version = 5.3.5

View file

@ -2,6 +2,7 @@ dependencies {
api libs.pdfbox
api project(':graphics-zxing')
runtimeOnly libs.pdfbox.jbig2
runtimeOnly libs.jai.jpeg2000
testImplementation testLibs.jfreechart
testImplementation project(':graphics-svg')
}

View file

@ -3,18 +3,19 @@ package org.xbib.graphics.pdfbox.test;
import org.junit.jupiter.api.Test;
import javax.imageio.ImageIO;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class JBig2Test {
private static final Logger logger = Logger.getLogger(JBig2Test.class.getName());
@Test
public void checkPlugins() {
ImageIO.scanForPlugins();
for (String suffix : ImageIO.getReaderFileSuffixes()) {
logger.log(Level.INFO, "ImageIO suffix: " + suffix);
}
Set<String> set = new LinkedHashSet<>();
Collections.addAll(set, ImageIO.getReaderFileSuffixes());
assertTrue(set.contains("jbig2"));
}
}

View file

@ -0,0 +1,23 @@
package org.xbib.graphics.pdfbox.test;
import org.junit.jupiter.api.Test;
import javax.imageio.ImageIO;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class JPEG2000Test {
@Test
public void checkPlugins() {
ImageIO.scanForPlugins();
Set<String> set = new LinkedHashSet<>();
Collections.addAll(set, ImageIO.getReaderFileSuffixes());
assertTrue(set.contains("jp2"));
}
}

View file

@ -23,6 +23,7 @@ dependencyResolutionManagement {
library('jna', 'net.java.dev.jna', 'jna').version('5.14.0')
library('pdfbox', 'org.apache.pdfbox', 'pdfbox').version('4.0.0-SNAPSHOT')
library('pdfbox.jbig2', 'org.apache.pdfbox', 'jbig2-imageio').version('3.0.4')
library('jai-jpeg2000', 'com.github.jai-imageio', 'jai-imageio-jpeg2000').version('1.4.0')
library('datastructures-settings', 'org.xbib', 'settings-datastructures').versionRef('datastructures')
library('datastructures-settings-json', 'org.xbib', 'settings-datastructures-json').versionRef('datastructures')
library('datastructures-settings-yaml', 'org.xbib', 'settings-datastructures-yaml').versionRef('datastructures')