Skip to content

Commit 85a9c36

Browse files
author
jamesmoore
committed
add itext metadata support
1 parent 81482d5 commit 85a9c36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SDMeta/Metadata/PngMetadataExtractor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class PngMetadataExtractor
3030
SkipBytes(fs, 4);
3131
break;
3232
case "tEXt":
33+
case "iTXt":
3334
var keywordValuePair = await ReadTextualData(fs, chunkLength);
3435
SkipBytes(fs, 4); // Move past the current chunk CRC
3536
yield return keywordValuePair;
@@ -80,7 +81,7 @@ private async static Task<string> ReadChunkType(Stream stream)
8081
var nullIndex = dataString.IndexOf(NullTerminator);
8182
return new (
8283
nullIndex > -1 ? dataString.Substring(0, nullIndex) : string.Empty,
83-
nullIndex > -1 && nullIndex + 1 < length ? dataString.Substring(nullIndex + 1).TrimEnd(NullTerminator) : string.Empty
84+
nullIndex > -1 && nullIndex + 1 < length ? dataString.Substring(nullIndex + 1).Trim(NullTerminator) : string.Empty
8485
);
8586
}
8687

0 commit comments

Comments
 (0)