mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-21 00:00:01 -04:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1dc6045079 | |||
| b9b3c364be | |||
| 26ecf18c68 | |||
| 3f356a8197 | |||
| dc59c66209 | |||
| 2a0b15f33f | |||
| 9ca9569537 | |||
| 0a717ea0af | |||
| 7f2eb517ef |
@@ -35,7 +35,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: mvn --batch-mode --no-transfer-progress test
|
run: mvn --batch-mode --no-transfer-progress test
|
||||||
- name: Publish Test Report
|
- name: Publish Test Report
|
||||||
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
|
uses: mikepenz/action-junit-report@74626db7353a25a20a72816467ebf035f674c5f8 # v5
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: mvn --batch-mode --no-transfer-progress test
|
run: mvn --batch-mode --no-transfer-progress test
|
||||||
- name: Publish Test Report
|
- name: Publish Test Report
|
||||||
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
|
uses: mikepenz/action-junit-report@74626db7353a25a20a72816467ebf035f674c5f8 # v5
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: mvn --batch-mode --no-transfer-progress test
|
run: mvn --batch-mode --no-transfer-progress test
|
||||||
- name: Publish Test Report
|
- name: Publish Test Report
|
||||||
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
|
uses: mikepenz/action-junit-report@74626db7353a25a20a72816467ebf035f674c5f8 # v5
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# 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).
|
# 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)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ 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
|
# 📚 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
|
# ./location_of_script_within_repo/buildscript.sh
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||||
# format to the repository Actions tab.
|
# format to the repository Actions tab.
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: SARIF file
|
name: SARIF file
|
||||||
path: results.sarif
|
path: results.sarif
|
||||||
@@ -57,6 +57,6 @@ jobs:
|
|||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
# Upload the results to GitHub's code scanning dashboard.
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
@@ -284,6 +284,20 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// NOTE: Extra cautions is taken, to only remove the entry if it
|
||||||
|
// equals the entry in the map
|
||||||
|
Object key = ((Entry) o).getKey();
|
||||||
|
Entry entry = (Entry) entries.get(key);
|
||||||
|
|
||||||
|
// Same entry?
|
||||||
|
if (entry != null && entry.equals(o)) {
|
||||||
|
return AbstractWrappedMap.this.remove(key) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
*/
|
||||||
|
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return AbstractDecoratedMap.this.removeEntry((Entry) o) != null;
|
return AbstractDecoratedMap.this.removeEntry((Entry) o) != null;
|
||||||
}
|
}
|
||||||
@@ -308,7 +322,7 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
|
|||||||
return containsKey(o);
|
return containsKey(o);
|
||||||
}
|
}
|
||||||
public boolean remove(Object o) {
|
public boolean remove(Object o) {
|
||||||
return AbstractDecoratedMap.this.removeEntry(getEntry((K) o)) != null;
|
return AbstractDecoratedMap.this.remove(o) != null;
|
||||||
}
|
}
|
||||||
public void clear() {
|
public void clear() {
|
||||||
AbstractDecoratedMap.this.clear();
|
AbstractDecoratedMap.this.clear();
|
||||||
|
|||||||
@@ -137,43 +137,43 @@ public final class BeanMap extends AbstractMap<String, Object> implements Serial
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class BeanIterator implements Iterator<Entry<String, Object>> {
|
private class BeanIterator implements Iterator<Entry<String, Object>> {
|
||||||
private final Iterator<PropertyDescriptor> iterator;
|
private final Iterator<PropertyDescriptor> mIterator;
|
||||||
|
|
||||||
public BeanIterator(final Iterator<PropertyDescriptor> pIterator) {
|
public BeanIterator(final Iterator<PropertyDescriptor> pIterator) {
|
||||||
iterator = pIterator;
|
mIterator = pIterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return iterator.hasNext();
|
return mIterator.hasNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BeanEntry next() {
|
public BeanEntry next() {
|
||||||
return new BeanEntry(iterator.next());
|
return new BeanEntry(mIterator.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
iterator.remove();
|
mIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class BeanEntry implements Entry<String, Object> {
|
private class BeanEntry implements Entry<String, Object> {
|
||||||
private final PropertyDescriptor descriptor;
|
private final PropertyDescriptor mDescriptor;
|
||||||
|
|
||||||
public BeanEntry(final PropertyDescriptor pDescriptor) {
|
public BeanEntry(final PropertyDescriptor pDescriptor) {
|
||||||
this.descriptor = pDescriptor;
|
this.mDescriptor = pDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return descriptor.getName();
|
return mDescriptor.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getValue() {
|
public Object getValue() {
|
||||||
return unwrap(new Wrapped() {
|
return unwrap(new Wrapped() {
|
||||||
public Object run() throws IllegalAccessException, InvocationTargetException {
|
public Object run() throws IllegalAccessException, InvocationTargetException {
|
||||||
final Method method = descriptor.getReadMethod();
|
final Method method = mDescriptor.getReadMethod();
|
||||||
// A write-only bean.
|
// A write-only bean.
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
throw new UnsupportedOperationException("No getter: " + descriptor.getName());
|
throw new UnsupportedOperationException("No getter: " + mDescriptor.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return method.invoke(bean);
|
return method.invoke(bean);
|
||||||
@@ -184,10 +184,10 @@ public final class BeanMap extends AbstractMap<String, Object> implements Serial
|
|||||||
public Object setValue(final Object pValue) {
|
public Object setValue(final Object pValue) {
|
||||||
return unwrap(new Wrapped() {
|
return unwrap(new Wrapped() {
|
||||||
public Object run() throws IllegalAccessException, InvocationTargetException {
|
public Object run() throws IllegalAccessException, InvocationTargetException {
|
||||||
final Method method = descriptor.getWriteMethod();
|
final Method method = mDescriptor.getWriteMethod();
|
||||||
// A read-only bean.
|
// A read-only bean.
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
throw new UnsupportedOperationException("No write method for property: " + descriptor.getName());
|
throw new UnsupportedOperationException("No write method for property: " + mDescriptor.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
final Object old = getValue();
|
final Object old = getValue();
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public abstract class ObjectAbstractTest {
|
|||||||
// TODO: What more can we test?
|
// TODO: What more can we test?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: assert that either BOTH or NONE of equals/hashcode is overridden
|
||||||
@Test
|
@Test
|
||||||
public void testEqualsHashCode(){
|
public void testEqualsHashCode(){
|
||||||
Object obj = makeObject();
|
Object obj = makeObject();
|
||||||
@@ -327,4 +328,5 @@ public abstract class ObjectAbstractTest {
|
|||||||
return new Cloneable() {};
|
return new Cloneable() {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
package com.twelvemonkeys.util;
|
package com.twelvemonkeys.util;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Nested;
|
|
||||||
|
|
||||||
import java.beans.IntrospectionException;
|
import java.beans.IntrospectionException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -174,16 +172,4 @@ public class BeanMapTest extends MapAbstractTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class NullBean implements Serializable { }
|
static class NullBean implements Serializable { }
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestBeanMapEntrySet extends TestMapEntrySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestBeanMapKeySet extends TestMapKeySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestBeanMapValues extends TestMapValues {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-15
@@ -436,24 +436,24 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
*/
|
*/
|
||||||
public Object[] getFullNonNullElements() {
|
public Object[] getFullNonNullElements() {
|
||||||
return new Object[] {
|
return new Object[] {
|
||||||
"",
|
new String(""),
|
||||||
"One",
|
new String("One"),
|
||||||
2,
|
new Integer(2),
|
||||||
"Three",
|
"Three",
|
||||||
4,
|
new Integer(4),
|
||||||
"One",
|
"One",
|
||||||
5.0,
|
new Double(5),
|
||||||
6F,
|
new Float(6),
|
||||||
"Seven",
|
"Seven",
|
||||||
"Eight",
|
"Eight",
|
||||||
"Nine",
|
new String("Nine"),
|
||||||
10,
|
new Integer(10),
|
||||||
(short) 11,
|
new Short((short)11),
|
||||||
12L,
|
new Long(12),
|
||||||
"Thirteen",
|
"Thirteen",
|
||||||
"14",
|
"14",
|
||||||
"15",
|
"15",
|
||||||
(byte) 16
|
new Byte((byte)16)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1149,7 +1149,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
public void testUnsupportedRemove() {
|
public void testUnsupportedRemove() {
|
||||||
if (isRemoveSupported()) return;
|
if (isRemoveSupported()) return;
|
||||||
|
|
||||||
resetFull();
|
resetEmpty();
|
||||||
try {
|
try {
|
||||||
collection.clear();
|
collection.clear();
|
||||||
fail("clear should raise UnsupportedOperationException");
|
fail("clear should raise UnsupportedOperationException");
|
||||||
@@ -1159,7 +1159,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
verifyAll();
|
verifyAll();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
collection.remove(getFullElements()[0]);
|
collection.remove(null);
|
||||||
fail("remove should raise UnsupportedOperationException");
|
fail("remove should raise UnsupportedOperationException");
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
// expected
|
// expected
|
||||||
@@ -1167,7 +1167,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
verifyAll();
|
verifyAll();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
collection.removeAll(Arrays.asList(getFullElements()));
|
collection.removeAll(null);
|
||||||
fail("removeAll should raise UnsupportedOperationException");
|
fail("removeAll should raise UnsupportedOperationException");
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
// expected
|
// expected
|
||||||
@@ -1175,7 +1175,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
verifyAll();
|
verifyAll();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
collection.retainAll(Collections.emptySet());
|
collection.retainAll(null);
|
||||||
fail("removeAll should raise UnsupportedOperationException");
|
fail("removeAll should raise UnsupportedOperationException");
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
// expected
|
// expected
|
||||||
@@ -1192,6 +1192,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
verifyAll();
|
verifyAll();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -212,17 +212,5 @@ public class LRUMapTest extends LinkedMapTest {
|
|||||||
list.add(pEntry.getKey());
|
list.add(pEntry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLRUMapEntrySet extends TestMapEntrySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLRUMapKeySet extends TestMapKeySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLRUMapValues extends TestMapValues {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -201,16 +201,4 @@ public class LinkedMapTest extends MapAbstractTest {
|
|||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
labRat = null;
|
labRat = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLinkedMapEntrySet extends TestMapEntrySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLinkedMapKeySet extends TestMapKeySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestLinkedMapValues extends TestMapValues {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1255,7 +1255,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected abstract class TestMapEntrySet extends SetAbstractTest {
|
public class TestMapEntrySet extends SetAbstractTest {
|
||||||
|
|
||||||
// Have to implement manually; entrySet doesn't support addAll
|
// Have to implement manually; entrySet doesn't support addAll
|
||||||
public Object[] getFullElements() {
|
public Object[] getFullElements() {
|
||||||
@@ -1429,7 +1429,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected abstract class TestMapKeySet extends SetAbstractTest {
|
public class TestMapKeySet extends SetAbstractTest {
|
||||||
public Object[] getFullElements() {
|
public Object[] getFullElements() {
|
||||||
return getSampleKeys();
|
return getSampleKeys();
|
||||||
}
|
}
|
||||||
@@ -1495,7 +1495,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected abstract class TestMapValues extends CollectionAbstractTest {
|
public class TestMapValues extends CollectionAbstractTest {
|
||||||
public Object[] getFullElements() {
|
public Object[] getFullElements() {
|
||||||
return getSampleValues();
|
return getSampleValues();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -668,17 +668,5 @@ public class TimeoutMapTest extends MapAbstractTest {
|
|||||||
assertFalse(timeoutMap.containsKey("xyz"));
|
assertFalse(timeoutMap.containsKey("xyz"));
|
||||||
assertNull(timeoutMap.get("xyz"));
|
assertNull(timeoutMap.get("xyz"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestTimeoutMapEntrySet extends TestMapEntrySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestTimeoutMapKeySet extends TestMapKeySet {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nested
|
|
||||||
public class TestTimeoutMapValues extends TestMapValues {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.14.4</junit.jupiter.version>
|
<junit.jupiter.version>5.14.3</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
</description>
|
</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.14.4</junit.jupiter.version>
|
<junit.jupiter.version>5.14.3</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.22.0</version>
|
<version>2.21.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
+24
-11
@@ -32,7 +32,6 @@ package com.twelvemonkeys.imageio.plugins.bmp;
|
|||||||
|
|
||||||
import com.twelvemonkeys.imageio.stream.SubImageOutputStream;
|
import com.twelvemonkeys.imageio.stream.SubImageOutputStream;
|
||||||
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
||||||
import com.twelvemonkeys.imageio.util.SequenceSupport;
|
|
||||||
|
|
||||||
import javax.imageio.IIOException;
|
import javax.imageio.IIOException;
|
||||||
import javax.imageio.IIOImage;
|
import javax.imageio.IIOImage;
|
||||||
@@ -65,7 +64,7 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
private static final int ICO_MAX_DIMENSION = 256;
|
private static final int ICO_MAX_DIMENSION = 256;
|
||||||
private static final int INITIAL_ENTRY_COUNT = 8;
|
private static final int INITIAL_ENTRY_COUNT = 8;
|
||||||
|
|
||||||
private final SequenceSupport sequence = new SequenceSupport();
|
private int sequenceIndex = -1;
|
||||||
|
|
||||||
private ImageWriter pngDelegate;
|
private ImageWriter pngDelegate;
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetMembers() {
|
protected void resetMembers() {
|
||||||
sequence.reset();
|
sequenceIndex = -1;
|
||||||
|
|
||||||
if (pngDelegate != null) {
|
if (pngDelegate != null) {
|
||||||
pngDelegate.dispose();
|
pngDelegate.dispose();
|
||||||
@@ -108,12 +107,16 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
@Override
|
@Override
|
||||||
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
sequence.start();
|
|
||||||
|
if (sequenceIndex >= 0) {
|
||||||
|
throw new IllegalStateException("writeSequence already started");
|
||||||
|
}
|
||||||
|
|
||||||
writeICOHeader();
|
writeICOHeader();
|
||||||
|
|
||||||
// Count: Needs to be updated for each new image
|
// Count: Needs to be updated for each new image
|
||||||
imageOutput.writeShort(0);
|
imageOutput.writeShort(0);
|
||||||
|
sequenceIndex = 0;
|
||||||
|
|
||||||
// TODO: Allow passing the initial size of the directory in the stream metadata?
|
// TODO: Allow passing the initial size of the directory in the stream metadata?
|
||||||
// - as this is much more efficient than growing...
|
// - as this is much more efficient than growing...
|
||||||
@@ -127,19 +130,27 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
@Override
|
@Override
|
||||||
public void endWriteSequence() {
|
public void endWriteSequence() {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
sequence.end();
|
|
||||||
|
if (sequenceIndex < 0) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
|
sequenceIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
int imageIndex = sequence.advance();
|
|
||||||
|
if (sequenceIndex < 0) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
if (image.hasRaster()) {
|
if (image.hasRaster()) {
|
||||||
throw new UnsupportedOperationException("Raster not supported");
|
throw new UnsupportedOperationException("Raster not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageIndex >= INITIAL_ENTRY_COUNT) {
|
if (sequenceIndex >= INITIAL_ENTRY_COUNT) {
|
||||||
growIfNecessary();
|
growIfNecessary();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +172,7 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
// Uncompressed, RLE4/RLE8 or PNG compressed
|
// Uncompressed, RLE4/RLE8 or PNG compressed
|
||||||
boolean pngCompression = param != null && "BI_PNG".equals(param.getCompressionType());
|
boolean pngCompression = param != null && "BI_PNG".equals(param.getCompressionType());
|
||||||
|
|
||||||
processImageStarted(imageIndex);
|
processImageStarted(sequenceIndex);
|
||||||
|
|
||||||
if (pngCompression) {
|
if (pngCompression) {
|
||||||
// NOTE: Embedding a PNG in a ICO is slightly different than a BMP with BI_PNG compression,
|
// NOTE: Embedding a PNG in a ICO is slightly different than a BMP with BI_PNG compression,
|
||||||
@@ -187,15 +198,17 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
|
|
||||||
// Update count
|
// Update count
|
||||||
imageOutput.seek(4);
|
imageOutput.seek(4);
|
||||||
imageOutput.writeShort(imageIndex + 1);
|
imageOutput.writeShort(sequenceIndex + 1);
|
||||||
|
|
||||||
// Write entry
|
// Write entry
|
||||||
int entryPosition = 6 + imageIndex * ENTRY_SIZE;
|
int entryPosition = 6 + sequenceIndex * ENTRY_SIZE;
|
||||||
imageOutput.seek(entryPosition);
|
imageOutput.seek(entryPosition);
|
||||||
|
|
||||||
long size = nextPosition - imageOffset;
|
long size = nextPosition - imageOffset;
|
||||||
writeEntry(width, height, colorModel, (int) size, (int) imageOffset);
|
writeEntry(width, height, colorModel, (int) size, (int) imageOffset);
|
||||||
|
|
||||||
|
sequenceIndex++;
|
||||||
|
|
||||||
imageOutput.seek(nextPosition);
|
imageOutput.seek(nextPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +265,7 @@ public final class ICOImageWriter extends DIBImageWriter {
|
|||||||
pngDelegate.addIIOWriteWarningListener(new IIOWriteWarningListener() {
|
pngDelegate.addIIOWriteWarningListener(new IIOWriteWarningListener() {
|
||||||
@Override
|
@Override
|
||||||
public void warningOccurred(ImageWriter source, int imageIndex, String warning) {
|
public void warningOccurred(ImageWriter source, int imageIndex, String warning) {
|
||||||
processWarningOccurred(sequence.current(), warning);
|
processWarningOccurred(sequenceIndex, warning);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
-115
@@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2026, Harald Kuhr
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright notice, this
|
|
||||||
* list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of the copyright holder nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived from
|
|
||||||
* this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.twelvemonkeys.imageio.util;
|
|
||||||
|
|
||||||
import javax.imageio.IIOImage;
|
|
||||||
import javax.imageio.ImageWriteParam;
|
|
||||||
import javax.imageio.ImageWriter;
|
|
||||||
import javax.imageio.metadata.IIOMetadata;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A tiny utility class that keeps state for sequences.
|
|
||||||
* For use by {@code ImageWriter} implementations that supports sequence (multiple images in same stream).
|
|
||||||
*
|
|
||||||
* @see ImageWriter#canWriteSequence()
|
|
||||||
*/
|
|
||||||
public final class SequenceSupport {
|
|
||||||
// Initial state, no sequence running
|
|
||||||
private int index = -1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets the sequence to initial state, regardless of the current sequence state.
|
|
||||||
*/
|
|
||||||
public void reset() {
|
|
||||||
index = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts a new sequence.
|
|
||||||
*
|
|
||||||
* @throws IllegalStateException if a sequence is already running.
|
|
||||||
* @see ImageWriter#prepareWriteSequence(IIOMetadata)
|
|
||||||
*/
|
|
||||||
public void start() {
|
|
||||||
if (index >= 0) {
|
|
||||||
throw new IllegalStateException("prepareWriteSequence already invoked");
|
|
||||||
}
|
|
||||||
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Advances the current sequence.
|
|
||||||
*
|
|
||||||
* @return the current sequence index.
|
|
||||||
* @throws IllegalStateException if a sequence is not running.
|
|
||||||
* @see ImageWriter#writeToSequence(IIOImage, ImageWriteParam)
|
|
||||||
*/
|
|
||||||
public int advance() {
|
|
||||||
if (index < 0) {
|
|
||||||
throw new IllegalStateException("prepareWriteSequence not invoked");
|
|
||||||
}
|
|
||||||
|
|
||||||
return index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the current sequence index.
|
|
||||||
*
|
|
||||||
* @return the current sequence index, or {@code -1} if a sequence is not running.
|
|
||||||
*/
|
|
||||||
public int current() {
|
|
||||||
// This method does not throw IllegalStateException, to allow
|
|
||||||
// ImageWriters to use the index in cases that may or may not
|
|
||||||
// happen "inside" a sequence.
|
|
||||||
// I'm not entirely sure if this is a good idea...
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ends the current sequence.
|
|
||||||
* The sequence is reset to initial state, and a new sequence may be started.
|
|
||||||
*
|
|
||||||
* @return the current (last) sequence index
|
|
||||||
* @throws IllegalStateException if a sequence is not running.
|
|
||||||
* @see ImageWriter#endWriteSequence()
|
|
||||||
*/
|
|
||||||
public int end() {
|
|
||||||
if (index < 0) {
|
|
||||||
throw new IllegalStateException("prepareWriteSequence not invoked");
|
|
||||||
}
|
|
||||||
|
|
||||||
int last = index;
|
|
||||||
index = -1;
|
|
||||||
|
|
||||||
return last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-89
@@ -1,89 +0,0 @@
|
|||||||
package com.twelvemonkeys.imageio.util;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
class SequenceSupportTest {
|
|
||||||
@Test
|
|
||||||
void happyCase() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
|
|
||||||
sequence.start();
|
|
||||||
assertEquals(0, sequence.current());
|
|
||||||
|
|
||||||
for (int i = 0; i < Byte.MAX_VALUE; i++) {
|
|
||||||
assertEquals(i, sequence.advance());
|
|
||||||
assertEquals(i + 1, sequence.current());
|
|
||||||
}
|
|
||||||
|
|
||||||
assertEquals(127, sequence.end());
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::advance);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void reset() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
sequence.reset();
|
|
||||||
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
|
|
||||||
sequence.start();
|
|
||||||
sequence.reset();
|
|
||||||
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
|
|
||||||
sequence.start();
|
|
||||||
sequence.advance();
|
|
||||||
sequence.reset();
|
|
||||||
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
|
|
||||||
sequence.start();
|
|
||||||
sequence.end();
|
|
||||||
sequence.reset();
|
|
||||||
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void startEnd() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
sequence.start();
|
|
||||||
sequence.end();
|
|
||||||
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void startAlreadyStarted() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
sequence.start();
|
|
||||||
|
|
||||||
assertThrows(IllegalStateException.class, sequence::start);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void advanceNotStarted() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
assertThrows(IllegalStateException.class, sequence::advance);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void currentNotStarted() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
assertEquals(-1, sequence.current());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void endNotStarted() {
|
|
||||||
SequenceSupport sequence = new SequenceSupport();
|
|
||||||
assertThrows(IllegalStateException.class, sequence::end);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+18
-12
@@ -47,12 +47,9 @@ import java.awt.Dimension;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
|
||||||
* @see <a href="https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dds-header">DDS_HEADER structure</a>
|
|
||||||
* @see <a href="https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide">Programming Guide for DDS</a>
|
|
||||||
*/
|
|
||||||
final class DDSHeader {
|
final class DDSHeader {
|
||||||
|
|
||||||
|
// https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide
|
||||||
private int flags;
|
private int flags;
|
||||||
|
|
||||||
private int mipMapCount;
|
private int mipMapCount;
|
||||||
@@ -72,16 +69,26 @@ final class DDSHeader {
|
|||||||
static DDSHeader read(final ImageInputStream imageInput) throws IOException {
|
static DDSHeader read(final ImageInputStream imageInput) throws IOException {
|
||||||
DDSHeader header = new DDSHeader();
|
DDSHeader header = new DDSHeader();
|
||||||
|
|
||||||
|
// Read MAGIC bytes [0,3]
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
// DDS_HEADER structure
|
||||||
|
// https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dds-header
|
||||||
int dwSize = imageInput.readInt(); // [4,7]
|
int dwSize = imageInput.readInt(); // [4,7]
|
||||||
if (dwSize != DDS.HEADER_SIZE) {
|
if (dwSize != DDS.HEADER_SIZE) {
|
||||||
throw new IIOException(String.format("Invalid DDS header size (expected %d): %d", DDS.HEADER_SIZE, dwSize));
|
throw new IIOException(String.format("Invalid DDS header size (expected %d): %d", DDS.HEADER_SIZE, dwSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify flags
|
// Verify setFlags
|
||||||
header.flags = imageInput.readInt(); // [8,11]
|
header.flags = imageInput.readInt(); // [8,11]
|
||||||
if (!header.hasFlag(DDS.FLAG_CAPS | DDS.FLAG_HEIGHT | DDS.FLAG_WIDTH | DDS.FLAG_PIXELFORMAT)) {
|
if (!header.getFlag(DDS.FLAG_CAPS
|
||||||
// NOTE: The Microsoft DDS documentation mention that readers should not rely on these flags...
|
| DDS.FLAG_HEIGHT
|
||||||
throw new IIOException("Required DDS flag missing in header: " + Integer.toBinaryString(header.flags));
|
| DDS.FLAG_WIDTH
|
||||||
|
| DDS.FLAG_PIXELFORMAT)) {
|
||||||
|
throw new IIOException("Required DDS Flag missing in header: " + Integer.toBinaryString(header.flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read Height & Width
|
// Read Height & Width
|
||||||
@@ -102,7 +109,7 @@ final class DDSHeader {
|
|||||||
// DDS_PIXELFORMAT structure
|
// DDS_PIXELFORMAT structure
|
||||||
int px_dwSize = imageInput.readInt(); // [76,79]
|
int px_dwSize = imageInput.readInt(); // [76,79]
|
||||||
if (px_dwSize != DDS.PIXELFORMAT_SIZE) {
|
if (px_dwSize != DDS.PIXELFORMAT_SIZE) {
|
||||||
throw new IIOException(String.format("Invalid DDS pixel format structure size (expected %d): %d", DDS.PIXELFORMAT_SIZE, dwSize));
|
throw new IIOException(String.format("Invalid DDS PIXELFORMAT size (expected %d): %d", DDS.PIXELFORMAT_SIZE, dwSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
header.pixelFormatFlags = imageInput.readInt(); // [80,83]
|
header.pixelFormatFlags = imageInput.readInt(); // [80,83]
|
||||||
@@ -121,7 +128,6 @@ final class DDSHeader {
|
|||||||
int dwReserved2 = imageInput.readInt(); // [124,127]
|
int dwReserved2 = imageInput.readInt(); // [124,127]
|
||||||
|
|
||||||
if (header.fourCC == DDSType.DXT10.fourCC()) {
|
if (header.fourCC == DDSType.DXT10.fourCC()) {
|
||||||
// If DXT10, the DXT10 header will follow immediately
|
|
||||||
header.dxt10Header = DXT10Header.read(imageInput);
|
header.dxt10Header = DXT10Header.read(imageInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,8 +146,8 @@ final class DDSHeader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasFlag(int mask) {
|
private boolean getFlag(int mask) {
|
||||||
return (flags & mask) == mask;
|
return (flags & mask) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getWidth(int imageIndex) {
|
int getWidth(int imageIndex) {
|
||||||
|
|||||||
+1
@@ -77,4 +77,5 @@ final class DDSImageMetadata extends StandardImageMetadataSupport {
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -33,7 +33,6 @@ package com.twelvemonkeys.imageio.plugins.dds;
|
|||||||
import com.twelvemonkeys.imageio.ImageReaderBase;
|
import com.twelvemonkeys.imageio.ImageReaderBase;
|
||||||
import com.twelvemonkeys.imageio.util.ImageTypeSpecifiers;
|
import com.twelvemonkeys.imageio.util.ImageTypeSpecifiers;
|
||||||
|
|
||||||
import javax.imageio.IIOException;
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.imageio.ImageReadParam;
|
import javax.imageio.ImageReadParam;
|
||||||
import javax.imageio.ImageTypeSpecifier;
|
import javax.imageio.ImageTypeSpecifier;
|
||||||
@@ -168,12 +167,6 @@ public final class DDSImageReader extends ImageReaderBase {
|
|||||||
private void readHeader() throws IOException {
|
private void readHeader() throws IOException {
|
||||||
if (header == null) {
|
if (header == null) {
|
||||||
imageInput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
imageInput.setByteOrder(ByteOrder.LITTLE_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));
|
|
||||||
}
|
|
||||||
|
|
||||||
header = DDSHeader.read(imageInput);
|
header = DDSHeader.read(imageInput);
|
||||||
imageInput.flushBefore(imageInput.getStreamPosition());
|
imageInput.flushBefore(imageInput.getStreamPosition());
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-24
@@ -2,7 +2,6 @@ package com.twelvemonkeys.imageio.plugins.dds;
|
|||||||
|
|
||||||
import com.twelvemonkeys.imageio.ImageWriterBase;
|
import com.twelvemonkeys.imageio.ImageWriterBase;
|
||||||
import com.twelvemonkeys.imageio.util.IIOUtil;
|
import com.twelvemonkeys.imageio.util.IIOUtil;
|
||||||
import com.twelvemonkeys.imageio.util.SequenceSupport;
|
|
||||||
|
|
||||||
import javax.imageio.IIOException;
|
import javax.imageio.IIOException;
|
||||||
import javax.imageio.IIOImage;
|
import javax.imageio.IIOImage;
|
||||||
@@ -30,9 +29,9 @@ import java.nio.file.Paths;
|
|||||||
*/
|
*/
|
||||||
class DDSImageWriter extends ImageWriterBase {
|
class DDSImageWriter extends ImageWriterBase {
|
||||||
|
|
||||||
private final SequenceSupport mipmapSequence = new SequenceSupport();
|
private long startPos;
|
||||||
|
// TODO: Create a SequenceSupport class that handles sequence prepare/write/end
|
||||||
private long headerStartPos;
|
private int mipmapIndex = -1;
|
||||||
private DDSType mipmapType;
|
private DDSType mipmapType;
|
||||||
private Dimension mipmapDimension;
|
private Dimension mipmapDimension;
|
||||||
|
|
||||||
@@ -47,8 +46,7 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetMembers() {
|
protected void resetMembers() {
|
||||||
headerStartPos = 0;
|
mipmapIndex = -1;
|
||||||
mipmapSequence.reset();
|
|
||||||
mipmapType = null;
|
mipmapType = null;
|
||||||
mipmapDimension = null;
|
mipmapDimension = null;
|
||||||
}
|
}
|
||||||
@@ -66,22 +64,30 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
@Override
|
@Override
|
||||||
public void prepareWriteSequence(IIOMetadata streamMetadata) throws IOException {
|
public void prepareWriteSequence(IIOMetadata streamMetadata) throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
mipmapSequence.start();
|
|
||||||
|
|
||||||
|
if (mipmapIndex >= 0) {
|
||||||
|
throw new IllegalStateException("writeSequence already started");
|
||||||
|
}
|
||||||
|
mipmapIndex = 0;
|
||||||
|
|
||||||
|
startPos = imageOutput.getStreamPosition();
|
||||||
imageOutput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
imageOutput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
||||||
imageOutput.writeInt(DDS.MAGIC);
|
imageOutput.writeInt(DDS.MAGIC);
|
||||||
imageOutput.flush();
|
imageOutput.flush();
|
||||||
|
|
||||||
headerStartPos = imageOutput.getStreamPosition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endWriteSequence() throws IOException {
|
public void endWriteSequence() throws IOException {
|
||||||
int mipmapCount = mipmapSequence.end();
|
assertOutput();
|
||||||
|
|
||||||
// Go back and update header
|
if (mipmapIndex < 0) {
|
||||||
updateHeader(mipmapCount);
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Go back and update hader
|
||||||
|
updateHeader(mipmapIndex);
|
||||||
|
|
||||||
|
mipmapIndex = -1;
|
||||||
mipmapType = null;
|
mipmapType = null;
|
||||||
mipmapDimension = null;
|
mipmapDimension = null;
|
||||||
|
|
||||||
@@ -97,12 +103,13 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToSequence(IIOImage image, ImageWriteParam param) throws IOException {
|
public void writeToSequence(IIOImage image, ImageWriteParam param) throws IOException {
|
||||||
int mipmapIndex = mipmapSequence.advance();
|
if (mipmapIndex < 0) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
Raster raster = getRaster(image);
|
Raster raster = getRaster(image);
|
||||||
ensureImageChannels(raster);
|
ensureImageChannels(raster);
|
||||||
ensureTextureDimension(raster);
|
ensureTextureDimension(raster);
|
||||||
mipmapDimension = new Dimension(raster.getWidth(), raster.getHeight());
|
|
||||||
|
|
||||||
DDSImageWriteParam ddsParam = param instanceof DDSImageWriteParam
|
DDSImageWriteParam ddsParam = param instanceof DDSImageWriteParam
|
||||||
? ((DDSImageWriteParam) param)
|
? ((DDSImageWriteParam) param)
|
||||||
@@ -113,7 +120,7 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
mipmapType = type;
|
mipmapType = type;
|
||||||
}
|
}
|
||||||
else if (type != mipmapType) {
|
else if (type != mipmapType) {
|
||||||
processWarningOccurred(mipmapIndex, "All images in DDS mipmap must use same pixel format and compression");
|
processWarningOccurred(mipmapIndex, "All images in DDS MipMap must use same pixel format and compression");
|
||||||
}
|
}
|
||||||
if (mipmapType == null) {
|
if (mipmapType == null) {
|
||||||
throw new IIOException("Only compressed DDS using DXT1-5 or DXT10 with block compression is currently supported");
|
throw new IIOException("Only compressed DDS using DXT1-5 or DXT10 with block compression is currently supported");
|
||||||
@@ -133,6 +140,9 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
processImageProgress(100f);
|
processImageProgress(100f);
|
||||||
processImageComplete();
|
processImageComplete();
|
||||||
|
|
||||||
|
mipmapDimension = new Dimension(raster.getWidth(), raster.getHeight());
|
||||||
|
mipmapIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Raster getRaster(IIOImage image) throws IIOException {
|
private static Raster getRaster(IIOImage image) throws IIOException {
|
||||||
@@ -200,7 +210,7 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
//dwDepth
|
//dwDepth
|
||||||
imageOutput.writeInt(0);
|
imageOutput.writeInt(0);
|
||||||
//dwMipmapCount
|
//dwMipmapCount
|
||||||
imageOutput.writeInt(1); // Should probably write 0 here for non-mipmap?
|
imageOutput.writeInt(1);
|
||||||
//reserved
|
//reserved
|
||||||
imageOutput.write(new byte[44]);
|
imageOutput.write(new byte[44]);
|
||||||
//pixFmt
|
//pixFmt
|
||||||
@@ -220,7 +230,7 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
long streamPosition = imageOutput.getStreamPosition();
|
long streamPosition = imageOutput.getStreamPosition();
|
||||||
imageOutput.seek(headerStartPos + 4); // Seek back to header start, skip 4 byte header size
|
imageOutput.seek(startPos + 8); // Seek back to start + 4 magic + 4 header size
|
||||||
|
|
||||||
int flags = imageOutput.readInt();
|
int flags = imageOutput.readInt();
|
||||||
imageOutput.seek(imageOutput.getStreamPosition() - 4);
|
imageOutput.seek(imageOutput.getStreamPosition() - 4);
|
||||||
@@ -258,14 +268,15 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
//dwRGBBitCount
|
//dwRGBBitCount
|
||||||
imageOutput.writeInt(type.blockSize() * 8); // TODO: Is bitcount always a multiple of 8?
|
imageOutput.writeInt(type.blockSize() * 8); // TODO: Is bitcount always a multiple of 8?
|
||||||
|
|
||||||
|
int[] mask = type.rgbaMasks;
|
||||||
//dwRBitMask
|
//dwRBitMask
|
||||||
imageOutput.writeInt(type.rgbaMasks[0]);
|
imageOutput.writeInt(mask[0]);
|
||||||
//dwGBitMask
|
//dwGBitMask
|
||||||
imageOutput.writeInt(type.rgbaMasks[1]);
|
imageOutput.writeInt(mask[1]);
|
||||||
//dwBBitMask
|
//dwBBitMask
|
||||||
imageOutput.writeInt(type.rgbaMasks[2]);
|
imageOutput.writeInt(mask[2]);
|
||||||
//dwABitMask
|
//dwABitMask
|
||||||
imageOutput.writeInt(type.rgbaMasks[3]);
|
imageOutput.writeInt(mask[3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//write 5 zero integers as fourCC is used
|
//write 5 zero integers as fourCC is used
|
||||||
@@ -291,8 +302,7 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
imageOutput.writeInt(DDS.PIXEL_FORMAT_FLAG_FOURCC);
|
imageOutput.writeInt(DDS.PIXEL_FORMAT_FLAG_FOURCC);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
imageOutput.writeInt(DDS.PIXEL_FORMAT_FLAG_RGB
|
imageOutput.writeInt(DDS.PIXEL_FORMAT_FLAG_RGB | (type.rgbaMasks != null ? DDS.PIXEL_FORMAT_FLAG_ALPHAPIXELS : 0));
|
||||||
| (type.rgbaMasks != null && type.rgbaMasks[3] != 0 ? DDS.PIXEL_FORMAT_FLAG_ALPHAPIXELS : 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +334,6 @@ class DDSImageWriter extends ImageWriterBase {
|
|||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
throw new IllegalArgumentException("Use 1 input file at a time.");
|
throw new IllegalArgumentException("Use 1 input file at a time.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageIO.write(ImageIO.read(new File(args[0])), "dds", new MemoryCacheImageOutputStream(Files.newOutputStream(Paths.get("output.dds"))));
|
ImageIO.write(ImageIO.read(new File(args[0])), "dds", new MemoryCacheImageOutputStream(Files.newOutputStream(Paths.get("output.dds"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-8
@@ -33,7 +33,6 @@ package com.twelvemonkeys.imageio.plugins.icns;
|
|||||||
import com.twelvemonkeys.imageio.ImageWriterBase;
|
import com.twelvemonkeys.imageio.ImageWriterBase;
|
||||||
import com.twelvemonkeys.imageio.stream.SubImageOutputStream;
|
import com.twelvemonkeys.imageio.stream.SubImageOutputStream;
|
||||||
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
||||||
import com.twelvemonkeys.imageio.util.SequenceSupport;
|
|
||||||
|
|
||||||
import javax.imageio.IIOException;
|
import javax.imageio.IIOException;
|
||||||
import javax.imageio.IIOImage;
|
import javax.imageio.IIOImage;
|
||||||
@@ -56,7 +55,7 @@ import java.util.Iterator;
|
|||||||
*/
|
*/
|
||||||
public final class ICNSImageWriter extends ImageWriterBase {
|
public final class ICNSImageWriter extends ImageWriterBase {
|
||||||
|
|
||||||
private final SequenceSupport sequence = new SequenceSupport();
|
private int sequenceIndex = -1;
|
||||||
private ImageWriter pngDelegate;
|
private ImageWriter pngDelegate;
|
||||||
|
|
||||||
ICNSImageWriter(ImageWriterSpi provider) {
|
ICNSImageWriter(ImageWriterSpi provider) {
|
||||||
@@ -65,7 +64,7 @@ public final class ICNSImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetMembers() {
|
protected void resetMembers() {
|
||||||
sequence.reset();
|
sequenceIndex = -1;
|
||||||
|
|
||||||
if (pngDelegate != null) {
|
if (pngDelegate != null) {
|
||||||
pngDelegate.dispose();
|
pngDelegate.dispose();
|
||||||
@@ -98,29 +97,41 @@ public final class ICNSImageWriter extends ImageWriterBase {
|
|||||||
@Override
|
@Override
|
||||||
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
sequence.start();
|
|
||||||
|
|
||||||
// TODO: Allow TOC resource to be passed as stream metadata?
|
// TODO: Allow TOC resource to be passed as stream metadata?
|
||||||
// - We only need number of icons to be written later
|
// - We only need number of icons to be written later
|
||||||
// - The contents of the TOC could be updated while adding to the sequence
|
// - The contents of the TOC could be updated while adding to the sequence
|
||||||
|
|
||||||
|
if (sequenceIndex >= 0) {
|
||||||
|
throw new IllegalStateException("writeSequence already started");
|
||||||
|
}
|
||||||
|
|
||||||
writeICNSHeader();
|
writeICNSHeader();
|
||||||
|
sequenceIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("RedundantThrows")
|
@SuppressWarnings("RedundantThrows")
|
||||||
@Override
|
@Override
|
||||||
public void endWriteSequence() throws IOException {
|
public void endWriteSequence() throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
sequence.end();
|
|
||||||
|
if (sequenceIndex < 0) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Now that we know the number of icon resources, we could move all data backwards
|
// TODO: Now that we know the number of icon resources, we could move all data backwards
|
||||||
// and write a TOC... But I don't think the benefit will outweigh the cost.
|
// and write a TOC... But I don't think the benefit will outweigh the cost.
|
||||||
|
|
||||||
|
sequenceIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
||||||
assertOutput();
|
assertOutput();
|
||||||
int imageIndex = sequence.advance();
|
|
||||||
|
if (sequenceIndex < 0) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence not called");
|
||||||
|
}
|
||||||
|
|
||||||
if (image.hasRaster()) {
|
if (image.hasRaster()) {
|
||||||
throw new UnsupportedOperationException("image has a Raster");
|
throw new UnsupportedOperationException("image has a Raster");
|
||||||
@@ -137,7 +148,7 @@ public final class ICNSImageWriter extends ImageWriterBase {
|
|||||||
imageOutput.writeInt(IconResource.typeFromImage(image.getRenderedImage(), "PNG"));
|
imageOutput.writeInt(IconResource.typeFromImage(image.getRenderedImage(), "PNG"));
|
||||||
imageOutput.writeInt(0); // Size, update later
|
imageOutput.writeInt(0); // Size, update later
|
||||||
|
|
||||||
processImageStarted(imageIndex);
|
processImageStarted(sequenceIndex);
|
||||||
|
|
||||||
// Write icon in PNG format
|
// Write icon in PNG format
|
||||||
ImageWriter writer = getPNGDelegate();
|
ImageWriter writer = getPNGDelegate();
|
||||||
@@ -197,7 +208,7 @@ public final class ICNSImageWriter extends ImageWriterBase {
|
|||||||
pngDelegate.addIIOWriteWarningListener(new IIOWriteWarningListener() {
|
pngDelegate.addIIOWriteWarningListener(new IIOWriteWarningListener() {
|
||||||
@Override
|
@Override
|
||||||
public void warningOccurred(ImageWriter source, int imageIndex, String warning) {
|
public void warningOccurred(ImageWriter source, int imageIndex, String warning) {
|
||||||
processWarningOccurred(sequence.current(), warning);
|
processWarningOccurred(sequenceIndex, warning);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-9
@@ -42,7 +42,6 @@ import com.twelvemonkeys.imageio.stream.SubImageOutputStream;
|
|||||||
import com.twelvemonkeys.imageio.util.IIOUtil;
|
import com.twelvemonkeys.imageio.util.IIOUtil;
|
||||||
import com.twelvemonkeys.imageio.util.ImageTypeSpecifiers;
|
import com.twelvemonkeys.imageio.util.ImageTypeSpecifiers;
|
||||||
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
import com.twelvemonkeys.imageio.util.ProgressListenerBase;
|
||||||
import com.twelvemonkeys.imageio.util.SequenceSupport;
|
|
||||||
import com.twelvemonkeys.io.enc.EncoderStream;
|
import com.twelvemonkeys.io.enc.EncoderStream;
|
||||||
import com.twelvemonkeys.io.enc.PackBitsEncoder;
|
import com.twelvemonkeys.io.enc.PackBitsEncoder;
|
||||||
import com.twelvemonkeys.lang.Validate;
|
import com.twelvemonkeys.lang.Validate;
|
||||||
@@ -111,7 +110,12 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
// Support storing multiple images in one stream (multi-page TIFF)
|
// Support storing multiple images in one stream (multi-page TIFF)
|
||||||
// Support more of the ImageIO metadata (ie. compression from metadata, etc)
|
// Support more of the ImageIO metadata (ie. compression from metadata, etc)
|
||||||
|
|
||||||
private final SequenceSupport sequence = new SequenceSupport();
|
/**
|
||||||
|
* Flag for active sequence writing
|
||||||
|
*/
|
||||||
|
private boolean writingSequence = false;
|
||||||
|
|
||||||
|
private int sequenceIndex = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata writer for sequence writing
|
* Metadata writer for sequence writing
|
||||||
@@ -747,7 +751,7 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
ifd = ((TIFFImageMetadata) inData).getIFD();
|
ifd = ((TIFFImageMetadata) inData).getIFD();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TIFFImageMetadata outData = new TIFFImageMetadata(Collections.emptySet());
|
TIFFImageMetadata outData = new TIFFImageMetadata(Collections.<Entry>emptySet());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Arrays.asList(inData.getMetadataFormatNames()).contains(SUN_NATIVE_IMAGE_METADATA_FORMAT_NAME)) {
|
if (Arrays.asList(inData.getMetadataFormatNames()).contains(SUN_NATIVE_IMAGE_METADATA_FORMAT_NAME)) {
|
||||||
@@ -762,7 +766,7 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IIOInvalidTreeException e) {
|
catch (IIOInvalidTreeException e) {
|
||||||
processWarningOccurred(sequence.current(), "Could not convert image meta data: " + e.getMessage());
|
processWarningOccurred(sequenceIndex, "Could not convert image meta data: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
ifd = outData.getIFD();
|
ifd = outData.getIFD();
|
||||||
@@ -962,11 +966,14 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
public void prepareWriteSequence(final IIOMetadata streamMetadata) throws IOException {
|
||||||
sequence.start();
|
if (writingSequence) {
|
||||||
|
throw new IllegalStateException("sequence writing has already been started!");
|
||||||
|
}
|
||||||
|
|
||||||
assertOutput();
|
assertOutput();
|
||||||
configureStreamByteOrder(streamMetadata, imageOutput);
|
configureStreamByteOrder(streamMetadata, imageOutput);
|
||||||
|
|
||||||
|
writingSequence = true;
|
||||||
sequenceTIFFWriter = new TIFFWriter(isBigTIFF() ? 8 : 4);
|
sequenceTIFFWriter = new TIFFWriter(isBigTIFF() ? 8 : 4);
|
||||||
sequenceTIFFWriter.writeTIFFHeader(imageOutput);
|
sequenceTIFFWriter.writeTIFFHeader(imageOutput);
|
||||||
sequenceLastIFDPos = imageOutput.getStreamPosition();
|
sequenceLastIFDPos = imageOutput.getStreamPosition();
|
||||||
@@ -978,20 +985,26 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException {
|
||||||
int sequenceIndex = sequence.advance();
|
if (!writingSequence) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence() must be called before writeToSequence()!");
|
||||||
|
}
|
||||||
|
|
||||||
if (sequenceIndex > 0) {
|
if (sequenceIndex > 0) {
|
||||||
imageOutput.flushBefore(sequenceLastIFDPos);
|
imageOutput.flushBefore(sequenceLastIFDPos);
|
||||||
imageOutput.seek(imageOutput.length());
|
imageOutput.seek(imageOutput.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
sequenceLastIFDPos = writePage(sequenceIndex, image, param, sequenceTIFFWriter, sequenceLastIFDPos);
|
sequenceLastIFDPos = writePage(sequenceIndex++, image, param, sequenceTIFFWriter, sequenceLastIFDPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endWriteSequence() throws IOException {
|
public void endWriteSequence() throws IOException {
|
||||||
sequence.end();
|
if (!writingSequence) {
|
||||||
|
throw new IllegalStateException("prepareWriteSequence() must be called before endWriteSequence()!");
|
||||||
|
}
|
||||||
|
|
||||||
|
writingSequence = false;
|
||||||
|
sequenceIndex = 0;
|
||||||
sequenceTIFFWriter = null;
|
sequenceTIFFWriter = null;
|
||||||
sequenceLastIFDPos = -1;
|
sequenceLastIFDPos = -1;
|
||||||
imageOutput.flush();
|
imageOutput.flush();
|
||||||
@@ -1001,7 +1014,8 @@ public final class TIFFImageWriter extends ImageWriterBase {
|
|||||||
protected void resetMembers() {
|
protected void resetMembers() {
|
||||||
super.resetMembers();
|
super.resetMembers();
|
||||||
|
|
||||||
sequence.reset();
|
writingSequence = false;
|
||||||
|
sequenceIndex = 0;
|
||||||
sequenceTIFFWriter = null;
|
sequenceTIFFWriter = null;
|
||||||
sequenceLastIFDPos = -1;
|
sequenceLastIFDPos = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.14.4</junit.jupiter.version>
|
<junit.jupiter.version>5.14.3</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -191,7 +191,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.5.0</version>
|
<version>3.4.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@
|
|||||||
</description>
|
</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.14.4</junit.jupiter.version>
|
<junit.jupiter.version>5.14.3</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.6.2</version>
|
<version>3.6.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>jakarta</id>
|
<id>jakarta</id>
|
||||||
|
|||||||
Reference in New Issue
Block a user