Skip to content
This repository was archived by the owner on Jan 8, 2023. It is now read-only.

Commit 29cc839

Browse files
committed
add some constants
1 parent ddff4a5 commit 29cc839

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/io/github/spair/byond/dmi/DmiWriter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
final class DmiWriter {
2828

2929
private static final String NATIVE_METADATA_FORMAT_NAME = "javax_imageio_png_1.0";
30+
private static final String COMPRESSED_META_ENTRY_NAME = "zTXtEntry";
31+
private static final String COMPRESSED_META_NODE_NAME = "zTXt";
3032

3133
private DmiWriter() {
3234
}
@@ -55,12 +57,12 @@ static void writeToFile(final File file, final Dmi dmi) throws IOException {
5557
}
5658

5759
private static IIOMetadataNode collectMetadataNodeForImage(final Dmi dmi) {
58-
val textEntry = new IIOMetadataNode("zTXtEntry");
60+
val textEntry = new IIOMetadataNode(COMPRESSED_META_ENTRY_NAME);
5961
textEntry.setAttribute("compressionMethod", "deflate");
6062
textEntry.setAttribute("keyword", "Description");
6163
textEntry.setAttribute("text", getMetadataText(dmi));
6264

63-
val textNode = new IIOMetadataNode("zTXt");
65+
val textNode = new IIOMetadataNode(COMPRESSED_META_NODE_NAME);
6466
textNode.appendChild(textEntry);
6567

6668
val root = new IIOMetadataNode(NATIVE_METADATA_FORMAT_NAME);

0 commit comments

Comments
 (0)