mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-26 00:00:07 -04:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eabbcd8a3 | |||
| 13a64ed3bb | |||
| 3c6df6ad1b | |||
| 9abe154ed3 | |||
| 0e752a2d2c |
@@ -32,7 +32,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@65fe03598d8d251738592a497a9e8547a5c48eaa # v5
|
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||||
@@ -58,7 +58,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@65fe03598d8d251738592a497a9e8547a5c48eaa # v5
|
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
report_paths: "**/target/surefire-reports/TEST*.xml"
|
report_paths: "**/target/surefire-reports/TEST*.xml"
|
||||||
@@ -92,7 +92,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@65fe03598d8d251738592a497a9e8547a5c48eaa # v5
|
uses: mikepenz/action-junit-report@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # 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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
|
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||||
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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
|
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||||
|
|
||||||
# ℹ️ 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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
|
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
|||||||
@@ -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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
|
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.13.0</junit.jupiter.version>
|
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
+7
-2
@@ -13,6 +13,11 @@
|
|||||||
Contributions to TwelveMonkeys and code that doesn't fit anywhere else.
|
Contributions to TwelveMonkeys and code that doesn't fit anywhere else.
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.twelvemonkeys.common</groupId>
|
<groupId>com.twelvemonkeys.common</groupId>
|
||||||
@@ -64,13 +69,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
<version>5.12.2</version>
|
<version>${junit.jupiter.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-api</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<version>5.12.2</version>
|
<version>${junit.jupiter.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
+7
-7
@@ -71,18 +71,18 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an empty TIFF metadata object.
|
* Creates an empty TIFF metadata object.
|
||||||
*
|
* <br/>
|
||||||
* Client code can update or change the metadata using the
|
* Client code can update or change the metadata using the
|
||||||
* {@link #setFromTree(String, Node)}
|
* {@link #setFromTree(String, Node)}
|
||||||
* or {@link #mergeTree(String, Node)} methods.
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
*/
|
*/
|
||||||
public TIFFImageMetadata() {
|
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.
|
* Creates a TIFF metadata object, using the values from the given IFD.
|
||||||
*
|
* <br/>
|
||||||
* Client code can update or change the metadata using the
|
* Client code can update or change the metadata using the
|
||||||
* {@link #setFromTree(String, Node)}
|
* {@link #setFromTree(String, Node)}
|
||||||
* or {@link #mergeTree(String, Node)} methods.
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
@@ -95,7 +95,7 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a TIFF metadata object, using the values from the given entries.
|
* Creates a TIFF metadata object, using the values from the given entries.
|
||||||
*
|
* <br/>
|
||||||
* Client code can update or change the metadata using the
|
* Client code can update or change the metadata using the
|
||||||
* {@link #setFromTree(String, Node)}
|
* {@link #setFromTree(String, Node)}
|
||||||
* or {@link #mergeTree(String, Node)} methods.
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
@@ -493,10 +493,10 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
|||||||
compressionTypeName.setAttribute("value", "CCITT RLE");
|
compressionTypeName.setAttribute("value", "CCITT RLE");
|
||||||
break;
|
break;
|
||||||
case TIFFExtension.COMPRESSION_CCITT_T4:
|
case TIFFExtension.COMPRESSION_CCITT_T4:
|
||||||
compressionTypeName.setAttribute("value", "CCITT T4");
|
compressionTypeName.setAttribute("value", "CCITT T.4");
|
||||||
break;
|
break;
|
||||||
case TIFFExtension.COMPRESSION_CCITT_T6:
|
case TIFFExtension.COMPRESSION_CCITT_T6:
|
||||||
compressionTypeName.setAttribute("value", "CCITT T6");
|
compressionTypeName.setAttribute("value", "CCITT T.6");
|
||||||
break;
|
break;
|
||||||
case TIFFExtension.COMPRESSION_LZW:
|
case TIFFExtension.COMPRESSION_LZW:
|
||||||
compressionTypeName.setAttribute("value", "LZW");
|
compressionTypeName.setAttribute("value", "LZW");
|
||||||
@@ -1038,7 +1038,7 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have resolution
|
// 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
|
// If old unit was DPI, convert values and keep DPI, otherwise use PPCM
|
||||||
Entry resUnitEntry = entries.get(TIFF.TAG_RESOLUTION_UNIT);
|
Entry resUnitEntry = entries.get(TIFF.TAG_RESOLUTION_UNIT);
|
||||||
int resUnitValue = resUnitEntry != null && resUnitEntry.getValue() != null
|
int resUnitValue = resUnitEntry != null && resUnitEntry.getValue() != null
|
||||||
|
|||||||
+96
@@ -188,6 +188,102 @@ public class TIFFImageMetadataTest {
|
|||||||
assertEquals("HP IL v1.1", ((Element) textEntry).getAttribute("value"));
|
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
|
@Test
|
||||||
public void testMetadataNativeFormat() throws IOException {
|
public void testMetadataNativeFormat() throws IOException {
|
||||||
IIOMetadata metadata = createMetadata("/tiff/quad-lzw.tif");
|
IIOMetadata metadata = createMetadata("/tiff/quad-lzw.tif");
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.13.0</junit.jupiter.version>
|
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
</description>
|
</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<junit.jupiter.version>5.13.0</junit.jupiter.version>
|
<junit.jupiter.version>5.13.1</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
Reference in New Issue
Block a user