mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Add "#png: unsupported CgBI extension" status
This commit is contained in:
1 parent
a55e0a02a2
commit
03fd43cfcc
3 files changed
+13
No files matched your search
@@ -9170,6 +9170,7 @@ extern const char wuffs_png__error__bad_filter[];
|
||||
extern const char wuffs_png__error__bad_header[];
|
||||
extern const char wuffs_png__error__bad_text_chunk_not_latin_1[];
|
||||
extern const char wuffs_png__error__missing_palette[];
|
||||
extern const char wuffs_png__error__unsupported_cgbi_extension[];
|
||||
extern const char wuffs_png__error__unsupported_png_compression_method[];
|
||||
extern const char wuffs_png__error__unsupported_png_file[];
|
||||
|
||||
@@ -35809,6 +35810,7 @@ const char wuffs_png__error__bad_filter[] = "#png: bad filter";
|
||||
const char wuffs_png__error__bad_header[] = "#png: bad header";
|
||||
const char wuffs_png__error__bad_text_chunk_not_latin_1[] = "#png: bad text chunk (not Latin-1)";
|
||||
const char wuffs_png__error__missing_palette[] = "#png: missing palette";
|
||||
const char wuffs_png__error__unsupported_cgbi_extension[] = "#png: unsupported CgBI extension";
|
||||
const char wuffs_png__error__unsupported_png_compression_method[] = "#png: unsupported PNG compression method";
|
||||
const char wuffs_png__error__unsupported_png_file[] = "#png: unsupported PNG file";
|
||||
const char wuffs_png__error__internal_error_inconsistent_i_o[] = "#png: internal error: inconsistent I/O";
|
||||
@@ -37803,6 +37805,10 @@ wuffs_png__decoder__decode_image_config(
|
||||
v_magic = t_1;
|
||||
}
|
||||
if (v_magic != 5927942488114331648) {
|
||||
if (v_magic == 5278895250759221248) {
|
||||
status = wuffs_base__make_status(wuffs_png__error__unsupported_cgbi_extension);
|
||||
goto exit;
|
||||
}
|
||||
status = wuffs_base__make_status(wuffs_png__error__bad_header);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user