Add "#png: unsupported CgBI extension" status

This commit is contained in:
Nigel Tao committed 2022-03-21 14:12:25 +11:00
1 parent a55e0a02a2
commit 03fd43cfcc
3 files changed
+13

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ pub status "#bad filter"
pub status "#bad header"
pub status "#bad text chunk (not Latin-1)"
pub status "#missing palette"
pub status "#unsupported CgBI extension"
pub status "#unsupported PNG compression method"
pub status "#unsupported PNG file"
+6
View File
@@ -219,6 +219,12 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
}
magic = args.src.read_u64le?()
if magic <> '\x00\x00\x00\x0DIHDR'le {
if magic == '\x00\x00\x00\x04CgBI'le {
// TODO: add support for Apple's unofficial CgBI extension to
// PNG, once there exists good documentation for it. See
// https://github.com/w3c/PNG-spec/issues/45
return "#unsupported CgBI extension"
}
return "#bad header"
}
this.chunk_type_array[0] = 'I'