mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-18 00:00:03 -04:00
Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 47e90a657a | |||
| bdd8b2f1fb | |||
| 8d08c9565b | |||
| c11f61d132 | |||
| e6b38cb547 | |||
| e11d888809 | |||
| 46a399ff02 | |||
| a09629be32 | |||
| 57fb1ca1bb | |||
| c9063ca02d | |||
| 340e79eb8a | |||
| 355a916225 | |||
| 8da45b5f05 | |||
| 6c8b0cdc2f | |||
| 8af219e669 | |||
| 7e10b9242d | |||
| 36103046a5 | |||
| 95787449ea | |||
| 3223743f2c | |||
| 234c7f59d4 | |||
| 1cb0da2967 | |||
| d1525828fa | |||
| 194fd5a446 | |||
| 21e5a465b9 | |||
| 6309bc5765 | |||
| 5011e98184 | |||
| a9aa5cc66e | |||
| ac107196eb | |||
| 489a419df1 | |||
| 51891b45ea | |||
| 90e60f509d | |||
| 53e5eff0c9 | |||
| 8670e1fd8a | |||
| 6395fd33e9 | |||
| 0834a2b1be | |||
| 6c75661ab4 | |||
| 9c25c962cc | |||
| 1328dbf763 | |||
| 8bccdef371 | |||
| 2d6f7d89fa | |||
| 1afa35ccd6 | |||
| 5b184a2a8a | |||
| 39bd218085 | |||
| 87af2f6212 | |||
| 598ea1e486 | |||
| 93180e7a2d | |||
| 2cc6d1d28e | |||
| 8ea9d6f318 | |||
| 029fa843f6 | |||
| 2cb4c0a661 | |||
| bf40c81123 | |||
| 78a90fab95 | |||
| b03f7a5582 | |||
| 96470c3897 | |||
| 365b19998f | |||
| b1846e1aed | |||
| ec63fbbd85 | |||
| fbea929bc5 | |||
| 18372944f1 | |||
| 488608b312 | |||
| b3ae8a8ba6 | |||
| fc3455d2c6 | |||
| f653279c62 | |||
| 0eff483d72 | |||
| 9c044b132b | |||
| 1ec4088e49 | |||
| 5ac415d019 | |||
| 133eafc8c2 | |||
| 85346a82e1 | |||
| e718e58b65 |
@@ -5,9 +5,13 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
open-pull-requests-limit: 10
|
||||
# GitHub actions updates
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/workflows"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
|
||||
+19
-18
@@ -17,13 +17,13 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
java: [ 11, 17, 21, 23 ]
|
||||
java: [ 11, 17, 21, 25 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
checks: write
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.java }}
|
||||
@@ -32,33 +32,33 @@ jobs:
|
||||
- name: Run Tests
|
||||
run: mvn --batch-mode --no-transfer-progress test
|
||||
- name: Publish Test Report
|
||||
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5
|
||||
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v5
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||
check_name: Unit Test Results for OpenJDK ${{ matrix.java }} on ${{ matrix.os }}
|
||||
|
||||
test-jdk8:
|
||||
name: Test OpenJDK ${{ matrix.java }} on ${{ matrix.os }}
|
||||
name: Test OpenJDK 8 on ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-13 ]
|
||||
os: [ ubuntu-latest, windows-latest, macos-14 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
checks: write
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
distribution: 'zulu'
|
||||
java-version: '8'
|
||||
java-package: jdk
|
||||
cache: 'maven'
|
||||
- name: Run Tests
|
||||
run: mvn --batch-mode --no-transfer-progress test
|
||||
- name: Publish Test Report
|
||||
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5
|
||||
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v5
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||
@@ -73,11 +73,11 @@ jobs:
|
||||
matrix:
|
||||
kcms: [ true, false ]
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- run: |
|
||||
download_url="https://javadl.oracle.com/webapps/download/AutoDL?BundleId=245038_d3c52aa6bfa54d3ca74e617f18309292"
|
||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
- name: Run Tests
|
||||
run: mvn --batch-mode --no-transfer-progress test
|
||||
- name: Publish Test Report
|
||||
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5
|
||||
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v5
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||
@@ -101,17 +101,18 @@ jobs:
|
||||
release:
|
||||
name: Deploy
|
||||
needs: [ test, test-jdk8, test-oracle ]
|
||||
# Temporarily disable deploy
|
||||
if: github.ref == 'refs/heads/master' # only perform on latest master
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Set up Maven Central
|
||||
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
|
||||
with: # running setup-java again overwrites the settings.xml
|
||||
distribution: 'temurin'
|
||||
java-version: '8'
|
||||
java-package: jdk
|
||||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
server-username: MAVEN_CENTRAL_USERNAME # env variable for username in deploy (1)
|
||||
server-password: MAVEN_CENTRAL_PASSWORD # env variable for token in deploy (2)
|
||||
- name: Get Project Version
|
||||
@@ -121,7 +122,7 @@ jobs:
|
||||
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
|
||||
run: mvn --batch-mode --no-transfer-progress deploy -P release -DskipTests -Dgpg.signer=bc
|
||||
env:
|
||||
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} # must be the same env variable name as (1)
|
||||
MAVEN_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} # must be the same env variable name as (2)
|
||||
MAVEN_CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} # must be the same env variable name as (1)
|
||||
MAVEN_CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} # must be the same env variable name as (2)
|
||||
MAVEN_GPG_KEY: ${{ secrets.GPG_KEY }} # Value of the GPG private key to import
|
||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
|
||||
@@ -33,11 +33,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||
uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||
uses: github/codeql-action/autobuild@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -64,6 +64,6 @@ jobs:
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||
uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
||||
@@ -26,12 +26,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@@ -57,6 +57,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||
uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.twelvemonkeys.bom</groupId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>common-image</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>common-io</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>common-lang</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
@@ -21,7 +21,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||
<junit.jupiter.version>5.14.1</junit.jupiter.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<groupId>com.twelvemonkeys.contrib</groupId>
|
||||
<artifactId>contrib</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||
<junit.jupiter.version>5.14.1</junit.jupiter.version>
|
||||
</properties>
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-batik</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: Batik Plugin</name>
|
||||
@@ -63,7 +63,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.19.0</version>
|
||||
<version>2.21.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+46
-1
@@ -36,9 +36,11 @@ import com.twelvemonkeys.lang.SystemUtil;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.spi.ServiceRegistry;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static com.twelvemonkeys.imageio.util.IIOUtil.deregisterProvider;
|
||||
|
||||
@@ -134,10 +136,42 @@ public final class SVGImageReaderSpi extends ImageReaderSpiBase {
|
||||
if (buffer[0] == 's' && buffer[1] == 'v' && buffer[2] == 'g'
|
||||
&& (Character.isWhitespace((char) buffer[3]) || buffer[3] == ':')) {
|
||||
// It's SVG, identified by root tag
|
||||
// TODO: Support svg with prefix + recognize namespace (http://www.w3.org/2000/svg)!
|
||||
return true;
|
||||
}
|
||||
|
||||
// Read the full tag name (may contain a prefix of any length)
|
||||
final int MAX_TAG_NAME = 256;
|
||||
ByteArrayOutputStream nameBuf = new ByteArrayOutputStream(MAX_TAG_NAME);
|
||||
|
||||
// We already have 4 bytes in 'buffer' (from input.readFully(buffer))
|
||||
int consumedFromBuffer = 0;
|
||||
for (; consumedFromBuffer < buffer.length; consumedFromBuffer++) {
|
||||
byte bb = buffer[consumedFromBuffer];
|
||||
if (bb == '>' || Character.isWhitespace((char) bb) || bb == '/') {
|
||||
break;
|
||||
}
|
||||
nameBuf.write(bb);
|
||||
}
|
||||
|
||||
// If tag name not terminated yet, keep reading bytes (within limit)
|
||||
final boolean incompleteTagName = consumedFromBuffer == buffer.length;
|
||||
readBuffer(input, nameBuf, output -> incompleteTagName && output.size() < MAX_TAG_NAME,
|
||||
bb -> bb == '>' || Character.isWhitespace(bb) || bb == '/');
|
||||
|
||||
final String name = nameBuf.toString("US-ASCII");
|
||||
if (name.toLowerCase(Locale.ENGLISH).endsWith(":svg")) {
|
||||
// Scan the rest of the tag attributes until '>' to find the SVG namespace URI
|
||||
ByteArrayOutputStream attrBuf = new ByteArrayOutputStream();
|
||||
final int MAX_ATTR_SCAN = 1024; // safe upper bound to keep it fast
|
||||
readBuffer(input, attrBuf, output -> output.size() < MAX_ATTR_SCAN, bb -> bb == '>');
|
||||
|
||||
// If the tag contains the SVG namespace, it's SVG.
|
||||
if (attrBuf.toString("US-ASCII").matches(
|
||||
".*xmlns:" + name.split(":")[0] + "\\s*=\\s*\"http://www.w3.org/2000/svg\".*")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// If the tag is not "svg", this isn't SVG
|
||||
return false;
|
||||
}
|
||||
@@ -157,6 +191,17 @@ public final class SVGImageReaderSpi extends ImageReaderSpiBase {
|
||||
}
|
||||
}
|
||||
|
||||
private static void readBuffer(final ImageInputStream input, final ByteArrayOutputStream buffer,
|
||||
final Predicate<ByteArrayOutputStream> loopCondition, Predicate<Byte> breakCondition) throws IOException {
|
||||
while (loopCondition.test(buffer)) {
|
||||
byte bb = input.readByte();
|
||||
if (breakCondition.test(bb)) {
|
||||
break;
|
||||
}
|
||||
buffer.write(bb);
|
||||
}
|
||||
}
|
||||
|
||||
public ImageReader createReaderInstance(final Object extension) throws IOException {
|
||||
return new SVGImageReader(this);
|
||||
}
|
||||
|
||||
+4
-1
@@ -56,7 +56,7 @@ public class SVGImageReaderSpiTest {
|
||||
"/svg/Android_robot.svg", // Minimal, no xml dec, no namespace
|
||||
"/svg/batikLogo.svg", // xml dec, comments, namespace
|
||||
"/svg/blue-square.svg", // xml dec, namespace
|
||||
"/svg/red-square.svg",
|
||||
"/svg/red-square.svg", // prefixed namespace
|
||||
};
|
||||
|
||||
private static final String[] INVALID_INPUTS = {
|
||||
@@ -70,6 +70,9 @@ public class SVGImageReaderSpiTest {
|
||||
"<!-- ", // #275 Infinite loop issue
|
||||
"<?123?>", // #275 Infinite loop issue
|
||||
"<svg",
|
||||
"<ns0:svg>", // namespace prefix undefined
|
||||
"<ns0:svg xmlns:ns0=\"foo\">", // not the official svg namespace
|
||||
"<ns0:svg xmlns:ns1=\"http://www.w3.org/2000/svg\">", // mismatching prefix
|
||||
};
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" id="red-square" version="1.1">
|
||||
<g id="layer1">
|
||||
<rect id="rect2985" width="100" height="100" x="0" y="0"
|
||||
<ns0:svg xmlns:ns0="http://www.w3.org/2000/svg" width="100" height="100" id="red-square" version="1.1">
|
||||
<ns0:g id="layer1">
|
||||
<ns0:rect id="rect2985" width="100" height="100" x="0" y="0"
|
||||
style="color:#000000;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
</g>
|
||||
</svg>
|
||||
</ns0:g>
|
||||
</ns0:svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 465 B |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-bmp</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: BMP plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-clippath</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: Photoshop Path Support</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-core</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: Core</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-dds</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: DDS plugin</name>
|
||||
|
||||
@@ -32,7 +32,7 @@ package com.twelvemonkeys.imageio.plugins.dds;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
interface DDS {
|
||||
byte[] MAGIC = new byte[]{'D', 'D', 'S', ' '};
|
||||
int MAGIC = ('D' << 24) + ('D' << 16) + ('S' << 8) + ' '; //Big-Endian
|
||||
int HEADER_SIZE = 124;
|
||||
|
||||
// Header Flags
|
||||
@@ -48,4 +48,7 @@ interface DDS {
|
||||
// Pixel Format Flags
|
||||
int PIXEL_FORMAT_FLAG_FOURCC = 0x04;
|
||||
int PIXEL_FORMAT_FLAG_RGB = 0x40;
|
||||
|
||||
//DX10 Resource Dimensions
|
||||
int D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3;
|
||||
}
|
||||
|
||||
+7
-8
@@ -34,8 +34,7 @@ import javax.imageio.IIOException;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import java.awt.Dimension;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
final class DDSHeader {
|
||||
|
||||
@@ -58,11 +57,12 @@ final class DDSHeader {
|
||||
DDSHeader header = new DDSHeader();
|
||||
|
||||
// Read MAGIC bytes [0,3]
|
||||
byte[] magic = new byte[DDS.MAGIC.length];
|
||||
imageInput.readFully(magic);
|
||||
if (!Arrays.equals(DDS.MAGIC, magic)) {
|
||||
throw new IIOException(String.format("Not a DDS file. Expected DDS magic 0x%08x', read 0x%08x", new BigInteger(DDS.MAGIC), new BigInteger(magic)));
|
||||
imageInput.setByteOrder(ByteOrder.BIG_ENDIAN);
|
||||
int magic = imageInput.readInt();
|
||||
if (magic != DDS.MAGIC) {
|
||||
throw new IIOException(String.format("Not a DDS file. Expected DDS magic 0x%8x', read 0x%8x", DDS.MAGIC, magic));
|
||||
}
|
||||
imageInput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
// DDS_HEADER structure
|
||||
// https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dds-header
|
||||
@@ -93,8 +93,7 @@ final class DDSHeader {
|
||||
// build dimensions list
|
||||
header.addDimensions(dwWidth, dwHeight);
|
||||
|
||||
byte[] dwReserved1 = new byte[11 * 4]; // [32,75]
|
||||
imageInput.readFully(dwReserved1);
|
||||
imageInput.skipBytes(44);
|
||||
|
||||
// DDS_PIXELFORMAT structure
|
||||
int px_dwSize = imageInput.readInt(); // [76,79]
|
||||
|
||||
+1
-5
@@ -35,7 +35,6 @@ import com.twelvemonkeys.imageio.spi.ImageReaderSpiBase;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class DDSImageReaderSpi extends ImageReaderSpiBase {
|
||||
@@ -55,10 +54,7 @@ public final class DDSImageReaderSpi extends ImageReaderSpiBase {
|
||||
stream.mark();
|
||||
|
||||
try {
|
||||
byte[] magic = new byte[DDS.MAGIC.length];
|
||||
stream.readFully(magic);
|
||||
|
||||
return Arrays.equals(DDS.MAGIC, magic);
|
||||
return stream.readInt() == DDS.MAGIC;
|
||||
} finally {
|
||||
stream.reset();
|
||||
}
|
||||
|
||||
+9
-5
@@ -74,15 +74,19 @@ final class DDSReader {
|
||||
static final Order ARGB_ORDER = new Order(16, 8, 0, 24);
|
||||
|
||||
private final DDSHeader header;
|
||||
private DX10Header dxt10Header;
|
||||
|
||||
DDSReader(DDSHeader header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
int[] read(ImageInputStream imageInput, int imageIndex) throws IOException {
|
||||
|
||||
// type
|
||||
DDSType type = getType();
|
||||
if (type == DDSType.DXT10) {
|
||||
dxt10Header = DX10Header.read(imageInput);
|
||||
type = dxt10Header.getDDSType();
|
||||
}
|
||||
|
||||
// offset buffer to index mipmap image
|
||||
byte[] buffer = null;
|
||||
@@ -138,7 +142,6 @@ final class DDSReader {
|
||||
// DXT
|
||||
int type = header.getFourCC();
|
||||
return DDSType.valueOf(type);
|
||||
|
||||
} else if ((flags & DDS.PIXEL_FORMAT_FLAG_RGB) != 0) {
|
||||
// RGB
|
||||
int bitCount = header.getBitCount();
|
||||
@@ -224,6 +227,7 @@ final class DDSReader {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static int[] decodeDXT1(int width, int height, byte[] buffer) {
|
||||
int[] pixels = new int[width * height];
|
||||
int index = 0;
|
||||
@@ -241,7 +245,7 @@ final class DDSReader {
|
||||
int t1 = (buffer[index] & 0x0C) >> 2;
|
||||
int t2 = (buffer[index] & 0x30) >> 4;
|
||||
int t3 = (buffer[index++] & 0xC0) >> 6;
|
||||
pixels[4 * width * i + 4 * j + width * k ] = getDXTColor(c0, c1, 0xFF, t0);
|
||||
pixels[4 * width * i + 4 * j + width * k] = getDXTColor(c0, c1, 0xFF, t0);
|
||||
if (4 * j + 1 >= width) continue;
|
||||
pixels[4 * width * i + 4 * j + width * k + 1] = getDXTColor(c0, c1, 0xFF, t1);
|
||||
if (4 * j + 2 >= width) continue;
|
||||
@@ -286,7 +290,7 @@ final class DDSReader {
|
||||
int t1 = (buffer[index] & 0x0C) >> 2;
|
||||
int t2 = (buffer[index] & 0x30) >> 4;
|
||||
int t3 = (buffer[index++] & 0xC0) >> 6;
|
||||
pixels[4 * width * i + 4 * j + width * k ] = getDXTColor(c0, c1, alphaTable[4 * k ], t0);
|
||||
pixels[4 * width * i + 4 * j + width * k] = getDXTColor(c0, c1, alphaTable[4 * k], t0);
|
||||
if (4 * j + 1 >= width) continue;
|
||||
pixels[4 * width * i + 4 * j + width * k + 1] = getDXTColor(c0, c1, alphaTable[4 * k + 1], t1);
|
||||
if (4 * j + 2 >= width) continue;
|
||||
@@ -344,7 +348,7 @@ final class DDSReader {
|
||||
int t1 = (buffer[index] & 0x0C) >> 2;
|
||||
int t2 = (buffer[index] & 0x30) >> 4;
|
||||
int t3 = (buffer[index++] & 0xC0) >> 6;
|
||||
pixels[4 * width * i + 4 * j + width * k ] = getDXTColor(c0, c1, getDXT5Alpha(a0, a1, alphaTable[4 * k ]), t0);
|
||||
pixels[4 * width * i + 4 * j + width * k] = getDXTColor(c0, c1, getDXT5Alpha(a0, a1, alphaTable[4 * k]), t0);
|
||||
if (4 * j + 1 >= width) continue;
|
||||
pixels[4 * width * i + 4 * j + width * k + 1] = getDXTColor(c0, c1, getDXT5Alpha(a0, a1, alphaTable[4 * k + 1]), t1);
|
||||
if (4 * j + 2 >= width) continue;
|
||||
|
||||
+1
-1
@@ -31,12 +31,12 @@
|
||||
package com.twelvemonkeys.imageio.plugins.dds;
|
||||
|
||||
enum DDSType {
|
||||
|
||||
DXT1(0x31545844),
|
||||
DXT2(0x32545844),
|
||||
DXT3(0x33545844),
|
||||
DXT4(0x34545844),
|
||||
DXT5(0x35545844),
|
||||
DXT10(0x30315844),
|
||||
A1R5G5B5((1 << 16) | 2),
|
||||
X1R5G5B5((2 << 16) | 2),
|
||||
A4R4G4B4((3 << 16) | 2),
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.twelvemonkeys.imageio.plugins.dds;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.IntPredicate;
|
||||
|
||||
/**
|
||||
* Enum that lists a certain types of DXGI Format this reader supports to read.
|
||||
*
|
||||
* <a href="https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format">DXGI Format List</a>
|
||||
*/
|
||||
public enum DX10DXGIFormat {
|
||||
BC1(DDSType.DXT1, rangeInclusive(70, 72)),
|
||||
BC2(DDSType.DXT2, rangeInclusive(73, 75)),
|
||||
BC3(DDSType.DXT5, rangeInclusive(76, 78)),
|
||||
//BC7(99),
|
||||
B8G8R8A8(DDSType.A8B8G8R8, exactly(87, 90, 91)),
|
||||
B8G8R8X8(DDSType.X8B8G8R8, exactly(88, 92, 93)),
|
||||
R8G8B8A8(DDSType.A8R8G8B8, rangeInclusive(27, 32));
|
||||
private final DDSType ddsType;
|
||||
private final IntPredicate dxgiFormat;
|
||||
|
||||
DX10DXGIFormat(DDSType ddsType, IntPredicate dxgiFormat) {
|
||||
this.ddsType = ddsType;
|
||||
this.dxgiFormat = dxgiFormat;
|
||||
}
|
||||
|
||||
DDSType getCorrespondingType() {
|
||||
return ddsType;
|
||||
}
|
||||
|
||||
static DX10DXGIFormat getFormat(int value) {
|
||||
for (DX10DXGIFormat format : values()) {
|
||||
if (format.dxgiFormat.test(value)) return format;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unsupported DXGI_FORMAT : " + value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param acceptedValues values in DXGI Formats List, passed values are expected to be in ascending order
|
||||
*/
|
||||
private static IntPredicate exactly(int ... acceptedValues) {
|
||||
return test -> Arrays.binarySearch(acceptedValues, test) >= 0;
|
||||
}
|
||||
|
||||
private static IntPredicate rangeInclusive(int from, int to) {
|
||||
return test -> from <= test && test <= to;
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.twelvemonkeys.imageio.plugins.dds;
|
||||
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
//https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dds-header-dxt10
|
||||
public final class DX10Header {
|
||||
final DX10DXGIFormat dxgiFormat;
|
||||
final int resourceDimension, miscFlag, arraySize, miscFlags2;
|
||||
|
||||
private DX10Header(int dxgiFormat, int resourceDimension, int miscFlag, int arraySize, int miscFlags2) {
|
||||
this.dxgiFormat = DX10DXGIFormat.getFormat(dxgiFormat);
|
||||
this.resourceDimension = resourceDimension;
|
||||
if (this.resourceDimension != DDS.D3D10_RESOURCE_DIMENSION_TEXTURE2D)
|
||||
throw new IllegalArgumentException("Resource dimension " + resourceDimension + " is not supported, expected 3.");
|
||||
this.miscFlag = miscFlag;
|
||||
this.arraySize = arraySize;
|
||||
this.miscFlags2 = miscFlags2;
|
||||
}
|
||||
|
||||
static DX10Header read(ImageInputStream inputStream) throws IOException {
|
||||
int dxgiFormat = inputStream.readInt();
|
||||
int resourceDimension = inputStream.readInt();
|
||||
int miscFlag = inputStream.readInt();
|
||||
int arraySize = inputStream.readInt();
|
||||
int miscFlags2 = inputStream.readInt();
|
||||
return new DX10Header(dxgiFormat, resourceDimension, miscFlag, arraySize, miscFlags2);
|
||||
}
|
||||
|
||||
DDSType getDDSType() {
|
||||
return dxgiFormat.getCorrespondingType();
|
||||
}
|
||||
}
|
||||
+7
-1
@@ -86,7 +86,13 @@ public class DDSImageReaderTest extends ImageReaderAbstractTest<DDSImageReader>
|
||||
new TestData(getClassLoaderResource("/dds/dds_X8B8G8R8.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dds_X8B8G8R8_mipmap.dds"), dim256, dim128, dim64),
|
||||
new TestData(getClassLoaderResource("/dds/dds_X8R8G8B8.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dds_X8R8G8B8_mipmap.dds"), dim256, dim128, dim64)
|
||||
new TestData(getClassLoaderResource("/dds/dds_X8R8G8B8_mipmap.dds"), dim256, dim128, dim64),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_BC1_sRGB.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_BC2_sRGB.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_BC3_sRGB.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_B8G8R8A8.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_B8G8R8X8.dds"), dim256),
|
||||
new TestData(getClassLoaderResource("/dds/dxt10_R8G8B8A8.dds"), dim256)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-hdr</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: HDR plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-icns</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: ICNS plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-iff</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: IFF plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-jpeg-jai-interop</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: JPEG/JAI TIFF Interop</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-jpeg-jep262-interop</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: JPEG/JEP-262 Interop</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-jpeg</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: JPEG plugin</name>
|
||||
|
||||
+23
-3
@@ -212,7 +212,9 @@ final class JPEGLosslessDecoder {
|
||||
|
||||
final int[] firstValue = new int[numComp];
|
||||
for (int i = 0; i < numComp; i++) {
|
||||
firstValue[i] = (1 << (precision - 1));
|
||||
// scan.approxLow is the point transformation (Pt) value
|
||||
// ref. ISO/IEC 10918-1 H.1.2.1
|
||||
firstValue[i] = (1 << (precision - scan.approxLow - 1));
|
||||
}
|
||||
|
||||
final int[] pred = new int[numComp];
|
||||
@@ -232,6 +234,11 @@ final class JPEGLosslessDecoder {
|
||||
output(pred);
|
||||
current = decode(pred, temp, index);
|
||||
}
|
||||
|
||||
if ((current == JPEG.EOI) && (xLoc == xDim - 1) && (yLoc == yDim - 1)) {
|
||||
// Output value left in pred if EOI is hit while decoding last pixel
|
||||
output(pred);
|
||||
}
|
||||
|
||||
break; //current=MARKER
|
||||
}
|
||||
@@ -268,6 +275,17 @@ final class JPEGLosslessDecoder {
|
||||
// TODO oe: 05.05.2018 Is it correct loop? Content of outputData from previous iteration is always lost.
|
||||
} while ((current != JPEG.EOI) && ((xLoc < xDim) && (yLoc < yDim)) && (scanNum == 0));
|
||||
|
||||
// Apply point transform to output. This must be done after it has finished being
|
||||
// used for predictive purposes.
|
||||
if (scan.approxLow != 0) {
|
||||
for (int componentIndex = 0; componentIndex < numComp; ++componentIndex) {
|
||||
int[] comp = outputData[componentIndex];
|
||||
for (int i = 0; i < comp.length; i++) {
|
||||
comp[i] = mask & (comp[i] << scan.approxLow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return outputData;
|
||||
}
|
||||
|
||||
@@ -329,9 +347,11 @@ final class JPEGLosslessDecoder {
|
||||
private int decodeSingle(final int[] prev, final int[] temp, final int[] index) throws IOException {
|
||||
// At the beginning of the first line and
|
||||
// at the beginning of each restart interval the prediction value of 2P – 1 is used, where P is the input precision.
|
||||
// If the point transformation parameter (see A.4) is non-zero, the prediction value at the beginning of the first lines and the
|
||||
// beginning of each restart interval is 2P – Pt – 1 , where Pt is the value of the point transformation parameter
|
||||
if (restarting) {
|
||||
restarting = false;
|
||||
prev[0] = (1 << (frame.samplePrecision - 1));
|
||||
prev[0] = (1 << (frame.samplePrecision - scan.approxLow - 1));
|
||||
}
|
||||
else {
|
||||
final int[] outputData = this.outputData[0];
|
||||
@@ -686,7 +706,7 @@ final class JPEGLosslessDecoder {
|
||||
return getPreviousY(data);
|
||||
}
|
||||
else {
|
||||
return (1 << (frame.samplePrecision - 1));
|
||||
return (1 << (frame.samplePrecision - scan.approxLow - 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+61
@@ -2033,4 +2033,65 @@ public class JPEGImageReaderTest extends ImageReaderAbstractTest<JPEGImageReader
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadLosslessJPEGGradient() throws IOException {
|
||||
JPEGImageReader reader = createReader();
|
||||
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getClassLoaderResource("/jpeg-lossless/gradient_ls.jpg"))) {
|
||||
reader.setInput(stream);
|
||||
|
||||
assertEquals(256, reader.getWidth(0));
|
||||
assertEquals(256, reader.getHeight(0));
|
||||
|
||||
BufferedImage image = reader.read(0, null);
|
||||
|
||||
assertNotNull(image);
|
||||
assertEquals(256, image.getWidth());
|
||||
assertEquals(256, image.getHeight());
|
||||
assertEquals(16, image.getColorModel().getComponentSize(0));
|
||||
|
||||
for (int y = 0; y < 256; y++) {
|
||||
for (int x = 0; x < 256; x++) {
|
||||
assertEquals((y << 8) | x, image.getRaster().getSample(x, y, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
reader.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadLosslessJPEGGradientWithPointTransform() throws IOException {
|
||||
JPEGImageReader reader = createReader();
|
||||
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getClassLoaderResource("/jpeg-lossless/gradient_ls_pt.jpg"))) {
|
||||
reader.setInput(stream);
|
||||
|
||||
assertEquals(256, reader.getWidth(0));
|
||||
assertEquals(256, reader.getHeight(0));
|
||||
|
||||
BufferedImage image = reader.read(0, null);
|
||||
|
||||
assertNotNull(image);
|
||||
assertEquals(256, image.getWidth());
|
||||
assertEquals(256, image.getHeight());
|
||||
assertEquals(16, image.getColorModel().getComponentSize(0));
|
||||
|
||||
for (int y = 0; y < 256; y++) {
|
||||
for (int x = 0; x < 256; x++) {
|
||||
int expected = (y << 8) | x;
|
||||
|
||||
// Simulate effect of precision loss due to point transform = 4
|
||||
expected = (expected >> 4) << 4;
|
||||
|
||||
assertEquals(expected, image.getRaster().getSample(x, y, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
reader.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>imageio-metadata</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-pcx</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: PCX plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-pdf</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: PDF plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-pict</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: PICT plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-pnm</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: PNM plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-psd</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: PSD plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-reference</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: JDK Reference Tests</name>
|
||||
|
||||
+6
@@ -111,6 +111,12 @@ public class JPEGImageReaderTest extends ImageReaderAbstractTest<JPEGImageReader
|
||||
super.testReadAsRenderedImageIndexOutOfBounds();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled("JDK 25 now supports reading Exif thumbnails, but does not report thumbnail progress")
|
||||
public void testThumbnailProgress() throws IOException {
|
||||
super.testThumbnailProgress();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled("No test data with JFIF thumbnail")
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-sgi</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: SGI plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-tga</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: TGA plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-thumbsdb</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: Thumbs.db plugin</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-tiff-jai-interop</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: TIFF/JAI Metadata Interop</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-tiff-jdk-interop</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: TIFF/JDK JPEG Interop</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-tiff</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: TIFF plugin</name>
|
||||
|
||||
+4
-7
@@ -71,18 +71,16 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
||||
|
||||
/**
|
||||
* Creates an empty TIFF metadata object.
|
||||
*
|
||||
* Client code can update or change the metadata using the
|
||||
* {@link #setFromTree(String, Node)}
|
||||
* or {@link #mergeTree(String, Node)} methods.
|
||||
*/
|
||||
public TIFFImageMetadata() {
|
||||
this(new IFD(Collections.<Entry>emptyList()));
|
||||
this(new IFD(Collections.emptyList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a TIFF metadata object, using the values from the given IFD.
|
||||
*
|
||||
* Client code can update or change the metadata using the
|
||||
* {@link #setFromTree(String, Node)}
|
||||
* or {@link #mergeTree(String, Node)} methods.
|
||||
@@ -95,7 +93,6 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
||||
|
||||
/**
|
||||
* Creates a TIFF metadata object, using the values from the given entries.
|
||||
*
|
||||
* Client code can update or change the metadata using the
|
||||
* {@link #setFromTree(String, Node)}
|
||||
* or {@link #mergeTree(String, Node)} methods.
|
||||
@@ -493,10 +490,10 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
||||
compressionTypeName.setAttribute("value", "CCITT RLE");
|
||||
break;
|
||||
case TIFFExtension.COMPRESSION_CCITT_T4:
|
||||
compressionTypeName.setAttribute("value", "CCITT T4");
|
||||
compressionTypeName.setAttribute("value", "CCITT T.4");
|
||||
break;
|
||||
case TIFFExtension.COMPRESSION_CCITT_T6:
|
||||
compressionTypeName.setAttribute("value", "CCITT T6");
|
||||
compressionTypeName.setAttribute("value", "CCITT T.6");
|
||||
break;
|
||||
case TIFFExtension.COMPRESSION_LZW:
|
||||
compressionTypeName.setAttribute("value", "LZW");
|
||||
@@ -1038,7 +1035,7 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
||||
}
|
||||
|
||||
// If we have resolution
|
||||
if (xRes != null && yRes != null) {
|
||||
if (xRes != null) { // yRes != null too
|
||||
// If old unit was DPI, convert values and keep DPI, otherwise use PPCM
|
||||
Entry resUnitEntry = entries.get(TIFF.TAG_RESOLUTION_UNIT);
|
||||
int resUnitValue = resUnitEntry != null && resUnitEntry.getValue() != null
|
||||
|
||||
+96
@@ -188,6 +188,102 @@ public class TIFFImageMetadataTest {
|
||||
assertEquals("HP IL v1.1", ((Element) textEntry).getAttribute("value"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetadataStandardFormat_CCITT300dpi() throws IOException {
|
||||
IIOMetadata metadata = createMetadata("/tiff/CCITT-G4-300dpi-StripByteCounts0.tif");
|
||||
Node root = metadata.getAsTree(IIOMetadataFormatImpl.standardMetadataFormatName);
|
||||
|
||||
// Root: "javax_imageio_1.0"
|
||||
assertNotNull(root);
|
||||
assertEquals(IIOMetadataFormatImpl.standardMetadataFormatName, root.getNodeName());
|
||||
assertEquals(5, root.getChildNodes().getLength());
|
||||
|
||||
// "Chroma"
|
||||
Node chroma = root.getFirstChild();
|
||||
assertEquals("Chroma", chroma.getNodeName());
|
||||
|
||||
assertEquals(3, chroma.getChildNodes().getLength());
|
||||
|
||||
Node colorSpaceType = chroma.getFirstChild();
|
||||
assertEquals("ColorSpaceType", colorSpaceType.getNodeName());
|
||||
assertEquals("GRAY", ((Element) colorSpaceType).getAttribute("name"));
|
||||
|
||||
Node numChannels = colorSpaceType.getNextSibling();
|
||||
assertEquals("NumChannels", numChannels.getNodeName());
|
||||
assertEquals("1", ((Element) numChannels).getAttribute("value"));
|
||||
|
||||
Node blackIsZero = numChannels.getNextSibling();
|
||||
assertEquals("BlackIsZero", blackIsZero.getNodeName());
|
||||
assertEquals("FALSE", ((Element) blackIsZero).getAttribute("value"));
|
||||
|
||||
// "Compression"
|
||||
Node compression = chroma.getNextSibling();
|
||||
assertEquals("Compression", compression.getNodeName());
|
||||
assertEquals(2, compression.getChildNodes().getLength());
|
||||
|
||||
Node compressionTypeName = compression.getFirstChild();
|
||||
assertEquals("CompressionTypeName", compressionTypeName.getNodeName());
|
||||
assertEquals("CCITT T.6", ((Element) compressionTypeName).getAttribute("value"));
|
||||
|
||||
Node lossless = compressionTypeName.getNextSibling();
|
||||
assertEquals("Lossless", lossless.getNodeName());
|
||||
assertEquals(0, lossless.getAttributes().getLength());
|
||||
|
||||
// "Data"
|
||||
Node data = compression.getNextSibling();
|
||||
assertEquals("Data", data.getNodeName());
|
||||
assertEquals(4, data.getChildNodes().getLength());
|
||||
|
||||
Node planarConfiguration = data.getFirstChild();
|
||||
assertEquals("PlanarConfiguration", planarConfiguration.getNodeName());
|
||||
assertEquals("PixelInterleaved", ((Element) planarConfiguration).getAttribute("value"));
|
||||
|
||||
Node sampleFormat = planarConfiguration.getNextSibling();
|
||||
assertEquals("SampleFormat", sampleFormat.getNodeName());
|
||||
assertEquals("UnsignedIntegral", ((Element) sampleFormat).getAttribute("value"));
|
||||
|
||||
Node bitsPerSample = sampleFormat.getNextSibling();
|
||||
assertEquals("BitsPerSample", bitsPerSample.getNodeName());
|
||||
assertEquals("1", ((Element) bitsPerSample).getAttribute("value"));
|
||||
|
||||
Node sampleMSB = bitsPerSample.getNextSibling();
|
||||
assertEquals("SampleMSB", sampleMSB.getNodeName());
|
||||
assertEquals("0", ((Element) sampleMSB).getAttribute("value"));
|
||||
|
||||
// "Dimension"
|
||||
Node dimension = data.getNextSibling();
|
||||
assertEquals("Dimension", dimension.getNodeName());
|
||||
assertEquals(4, dimension.getChildNodes().getLength());
|
||||
|
||||
Node pixelAspectRatio = dimension.getFirstChild();
|
||||
assertEquals("PixelAspectRatio", pixelAspectRatio.getNodeName());
|
||||
assertEquals("1.0", ((Element) pixelAspectRatio).getAttribute("value"));
|
||||
|
||||
Node imageOrientation = pixelAspectRatio.getNextSibling();
|
||||
assertEquals("ImageOrientation", imageOrientation.getNodeName());
|
||||
assertEquals("Normal", ((Element) imageOrientation).getAttribute("value"));
|
||||
|
||||
Node horizontalPixelSize = imageOrientation.getNextSibling();
|
||||
assertEquals("HorizontalPixelSize", horizontalPixelSize.getNodeName());
|
||||
assertEquals("0.08466666666666667", ((Element) horizontalPixelSize).getAttribute("value"));
|
||||
|
||||
Node verticalPixelSize = horizontalPixelSize.getNextSibling();
|
||||
assertEquals("VerticalPixelSize", verticalPixelSize.getNodeName());
|
||||
assertEquals("0.08466666666666667", ((Element) verticalPixelSize).getAttribute("value"));
|
||||
|
||||
// "Document"
|
||||
Node document = dimension.getNextSibling();
|
||||
assertEquals("Document", document.getNodeName());
|
||||
assertEquals(1, document.getChildNodes().getLength());
|
||||
|
||||
Node formatVersion = document.getFirstChild();
|
||||
assertEquals("FormatVersion", formatVersion.getNodeName());
|
||||
assertEquals("6.0", ((Element) formatVersion).getAttribute("value"));
|
||||
|
||||
// No more elements
|
||||
assertNull(document.getNextSibling());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetadataNativeFormat() throws IOException {
|
||||
IIOMetadata metadata = createMetadata("/tiff/quad-lzw.tif");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-webp</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: WebP plugin</name>
|
||||
|
||||
+9
-5
@@ -148,8 +148,7 @@ public final class VP8LDecoder {
|
||||
if (param.getSourceRegion() != null && !param.getSourceRegion().contains(bounds) ||
|
||||
param.getSourceXSubsampling() != 1 || param.getSourceYSubsampling() != 1) {
|
||||
// Can't reuse existing
|
||||
return Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, bounds.width, bounds.height,
|
||||
4 * bounds.width, 4, new int[] {0, 1, 2, 3}, null);
|
||||
return createCompatibleRaster(raster, bounds.width, bounds.height);
|
||||
}
|
||||
else {
|
||||
bounds.setLocation(param.getDestinationOffset());
|
||||
@@ -159,8 +158,7 @@ public final class VP8LDecoder {
|
||||
|
||||
if (!raster.getBounds().contains(bounds)) {
|
||||
// Can't reuse existing
|
||||
return Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, bounds.width, bounds.height, 4 * bounds.width,
|
||||
4, new int[] {0, 1, 2, 3}, null);
|
||||
return createCompatibleRaster(raster, bounds.width, bounds.height);
|
||||
}
|
||||
|
||||
return originSet ?
|
||||
@@ -169,6 +167,11 @@ public final class VP8LDecoder {
|
||||
raster;
|
||||
}
|
||||
|
||||
private static WritableRaster createCompatibleRaster(WritableRaster src, int width, int height) {
|
||||
SampleModel sampleModel = src.getSampleModel().createCompatibleSampleModel(width, height);
|
||||
return Raster.createWritableRaster(sampleModel, sampleModel.createDataBuffer(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a source raster into a destination raster with optional settings applied.
|
||||
*/
|
||||
@@ -182,7 +185,8 @@ public final class VP8LDecoder {
|
||||
|
||||
if (sourceXSubsampling == 1 && sourceYSubsampling == 1) {
|
||||
// Only apply offset (and limit to requested region)
|
||||
dstRaster.setRect(destinationOffset.x, destinationOffset.y, srcRaster);
|
||||
dstRaster.setRect(destinationOffset.x, destinationOffset.y, srcRaster.createChild(
|
||||
sourceRegion.x, sourceRegion.y, sourceRegion.width, sourceRegion.height, 0, 0, null));
|
||||
}
|
||||
else {
|
||||
// Subsampled case
|
||||
|
||||
+78
@@ -43,6 +43,7 @@ public class WebPImageReaderTest extends ImageReaderAbstractTest<WebPImageReader
|
||||
new TestData(getClassLoaderResource("/webp/1_webp_ll.webp"), new Dimension(400, 301)),
|
||||
new TestData(getClassLoaderResource("/webp/2_webp_ll.webp"), new Dimension(386, 395)),
|
||||
new TestData(getClassLoaderResource("/webp/2_webp_ll_alt.webp"), new Dimension(386, 395)),
|
||||
new TestData(getClassLoaderResource("/webp/2_webp_ll_noalpha.webp"), new Dimension(386, 395)),
|
||||
new TestData(getClassLoaderResource("/webp/3_webp_ll.webp"), new Dimension(800, 600)),
|
||||
new TestData(getClassLoaderResource("/webp/4_webp_ll.webp"), new Dimension(421, 163)),
|
||||
new TestData(getClassLoaderResource("/webp/5_webp_ll.webp"), new Dimension(300, 300)),
|
||||
@@ -188,4 +189,81 @@ public class WebPImageReaderTest extends ImageReaderAbstractTest<WebPImageReader
|
||||
reader.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLosslessSourceRegionSubsampling() throws IOException {
|
||||
WebPImageReader reader = createReader();
|
||||
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getClassLoaderResource("/webp/2_webp_ll_noalpha.webp"))) {
|
||||
reader.setInput(stream);
|
||||
|
||||
// We'll read a small portion of the image using a subsampling factor of 2
|
||||
ImageReadParam param = reader.getDefaultReadParam();
|
||||
param.setSourceRegion(new Rectangle(100, 20, 200, 200));
|
||||
param.setSourceSubsampling(2, 2, 0, 0);
|
||||
|
||||
BufferedImage image = reader.read(0, param);
|
||||
|
||||
for (int x = 0; x < 23; x++) {
|
||||
assertRGBEquals("Expected white at (" + x + ", 0)", 0xFFFFFFFF, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 24; x < 29; x++) {
|
||||
assertRGBEquals("Expected black at (" + x + ", 0)", 0xFF000000, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 30; x < 64; x++) {
|
||||
assertRGBEquals("Expected grey at (" + x + ", 0)", 0xFFF1F1F1, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 66; x < 69; x++) {
|
||||
assertRGBEquals("Expected black at (" + x + ", 0)", 0xFF000000, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 70; x < 100; x++) {
|
||||
assertRGBEquals("Expected white at (" + x + ", 0)", 0xFFFFFFFF, image.getRGB(x, 0), 0);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
reader.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLosslessSourceRegionNoSubsampling() throws IOException {
|
||||
WebPImageReader reader = createReader();
|
||||
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getClassLoaderResource("/webp/2_webp_ll_noalpha.webp"))) {
|
||||
reader.setInput(stream);
|
||||
|
||||
// We'll read a small portion of the image without using subsampling
|
||||
ImageReadParam param = reader.getDefaultReadParam();
|
||||
param.setSourceRegion(new Rectangle(100, 20, 200, 200));
|
||||
|
||||
BufferedImage image = reader.read(0, param);
|
||||
|
||||
for (int x = 0; x < 45; x++) {
|
||||
assertRGBEquals("Expected white at (" + x + ", 0)", 0xFFFFFFFF, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 48; x < 58; x++) {
|
||||
assertRGBEquals("Expected black at (" + x + ", 0)", 0xFF000000, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 60; x < 128; x++) {
|
||||
assertRGBEquals("Expected grey at (" + x + ", 0)", 0xFFF1F1F1, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 131; x < 138; x++) {
|
||||
assertRGBEquals("Expected black at (" + x + ", 0)", 0xFF000000, image.getRGB(x, 0), 0);
|
||||
}
|
||||
|
||||
for (int x = 140; x < 200; x++) {
|
||||
assertRGBEquals("Expected white at (" + x + ", 0)", 0xFFFFFFFF, image.getRGB(x, 0), 0);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
reader.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<artifactId>imageio-xwd</artifactId>
|
||||
<name>TwelveMonkeys :: ImageIO :: XWD plugin</name>
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
@@ -61,7 +61,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||
<junit.jupiter.version>5.14.1</junit.jupiter.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>TwelveMonkeys</name>
|
||||
<description>TwelveMonkeys parent POM</description>
|
||||
@@ -80,13 +80,13 @@
|
||||
<connection>scm:git:https://github.com/haraldk/TwelveMonkeys</connection>
|
||||
<developerConnection>scm:git:ssh://git@github.com/haraldk/TwelveMonkeys</developerConnection>
|
||||
<url>https://github.com/haraldk/TwelveMonkeys</url>
|
||||
<tag>HEAD</tag>
|
||||
<tag>twelvemonkeys-3.13.0</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<id>central</id>
|
||||
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.2.7</version>
|
||||
<version>3.2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@@ -112,7 +112,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<version>3.12.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
@@ -160,7 +160,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<version>3.4.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@@ -174,14 +174,14 @@
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.7.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
<autoPublish>true</autoPublish>
|
||||
<waitUntil>published</waitUntil>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -191,7 +191,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<version>3.4.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
@@ -199,7 +199,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.5.0</version>
|
||||
<inherited>true</inherited>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -250,7 +250,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<version>3.14.1</version>
|
||||
<inherited>true</inherited>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
@@ -265,7 +265,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<version>3.5.4</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
@@ -278,7 +278,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<releaseProfiles>release</releaseProfiles>
|
||||
@@ -288,7 +288,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
@@ -300,7 +300,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<version>3.5.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
@@ -310,7 +310,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.26.0</version>
|
||||
<version>3.28.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys</groupId>
|
||||
<artifactId>twelvemonkeys</artifactId>
|
||||
<version>3.12.1-SNAPSHOT</version>
|
||||
<version>3.13.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -15,7 +15,7 @@
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||
<junit.jupiter.version>5.14.1</junit.jupiter.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -61,7 +61,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
@@ -82,7 +82,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.6.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jakarta</id>
|
||||
|
||||
Reference in New Issue
Block a user