Let std/png decode iTXt, tEXt and zTXt chunks

Updates #55
This commit is contained in:
Nigel Tao committed 2021-11-17 11:56:49 +11:00
1 parent 3642d73714
commit 6737565c20
8 files changed
+708 -87

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

@@ -0,0 +1,99 @@
# Feed this file to script/make-artificial.go
make png
magic
IHDR {
raw {
# Width, height.
0x00 0x00 0x00 0x01
0x00 0x00 0x00 0x01
# Depth, color, compression, filter, interlace.
0x08 0x00 0x00 0x00 0x00
}
}
# Basic key-value pair.
tEXt {
raw {
# "Key\x00".
0x4B 0x65 0x79 0x00
# "English".
0x45 0x6E 0x67 0x6C 0x69 0x73 0x68
}
}
# Latin-1 (not UTF-8) uncompressed key-value pair.
tEXt {
raw {
# asLatin1("Clé\x00").
0x43 0x6C 0xE9 0x00
# asLatin1("Français").
0x46 0x72 0x61 0x6E 0xE7 0x61 0x69 0x73
}
}
# Latin-1 (not UTF-8) zlib-compressed key-value pair.
zTXt {
raw {
# asLatin1("zlïbK\x00").
0x7A 0x6C 0xEF 0x62 0x4B 0x00
# Compression method.
0x00
}
zlib {
# asLatin1("zlïbV").
0x7A 0x6C 0xEF 0x62 0x56
}
}
# UTF-8 uncompressed key-value pair.
iTXt {
raw {
# "U-Key\x00".
0x55 0x2D 0x4B 0x65 0x79 0x00
# Compression flag, compression method.
0x00 0x00
# Language tag: "ru\x00".
0x72 0x75 0x00
# Translated key: "U-ключ\x00".
0x55 0x2D 0xD0 0xBA 0xD0 0xBB 0xD1 0x8E
0xD1 0x87 0x00
# "U-значение".
0x55 0x2D 0xD0 0xB7 0xD0 0xBD 0xD0 0xB0
0xD1 0x87 0xD0 0xB5 0xD0 0xBD 0xD0 0xB8
0xD0 0xB5
}
}
# Latin-1 / UTF-8 zlib-compressed key-value pair.
iTXt {
raw {
# asLatin1("Z-Këy\x00").
0x5A 0x2D 0x4B 0xEB 0x79 0x00
# Compression flag, compression method.
0x01 0x00
# Language tag: "ru\x00".
0x72 0x75 0x00
# Translated key: "Z-ключ\x00".
0x5A 0x2D 0xD0 0xBA 0xD0 0xBB 0xD1 0x8E
0xD1 0x87 0x00
}
zlib {
# "Z-значение".
0x5A 0x2D 0xD0 0xB7 0xD0 0xBD 0xD0 0xB0
0xD1 0x87 0xD0 0xB5 0xD0 0xBD 0xD0 0xB8
0xD0 0xB5
}
}
IDAT {
zlib {
# 1x1 gray pixels (with filter bytes).
0x00 0x80
}
}
IEND {
}