diff --git a/internal/cgen/base/magic-submodule.c b/internal/cgen/base/magic-submodule.c index bf580d17..4ca558ea 100644 --- a/internal/cgen/base/magic-submodule.c +++ b/internal/cgen/base/magic-submodule.c @@ -36,6 +36,7 @@ wuffs_base__magic_number_guess_fourcc(wuffs_base__slice_u8 prefix) { {+0x54494646, "\x03\x4D\x4D\x00\x2A"}, // TIFF (big-endian) {-0x52494646, "\x03\x52\x49\x46\x46"}, // RIFF {+0x4E494520, "\x02\x6E\xC3\xAF"}, // NIE + {+0x514F4920, "\x03\x71\x6F\x69\x66"}, // QOI {+0x504E4720, "\x03\x89\x50\x4E\x47"}, // PNG {+0x4A504547, "\x01\xFF\xD8"}, // JPEG }; diff --git a/lang/builtin/builtin.go b/lang/builtin/builtin.go index 1ebc8650..19f6eb5e 100644 --- a/lang/builtin/builtin.go +++ b/lang/builtin/builtin.go @@ -66,6 +66,7 @@ var FourCCs = [...][2]string{ {"PNG ", "Portable Network Graphics"}, {"PNM ", "Portable Anymap"}, {"PS ", "PostScript"}, + {"QOI ", "Quite OK Image"}, {"RAC ", "Random Access Compression"}, {"RAW ", "Raw"}, {"RIFF", "Resource Interchange File Format"}, diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 85013d6c..9ce5434e 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -686,6 +686,9 @@ typedef struct wuffs_base__transform__output__struct { // PostScript. #define WUFFS_BASE__FOURCC__PS 0x50532020 +// Quite OK Image. +#define WUFFS_BASE__FOURCC__QOI 0x514F4920 + // Random Access Compression. #define WUFFS_BASE__FOURCC__RAC 0x52414320 @@ -15591,6 +15594,7 @@ wuffs_base__magic_number_guess_fourcc(wuffs_base__slice_u8 prefix) { {+0x54494646, "\x03\x4D\x4D\x00\x2A"}, // TIFF (big-endian) {-0x52494646, "\x03\x52\x49\x46\x46"}, // RIFF {+0x4E494520, "\x02\x6E\xC3\xAF"}, // NIE + {+0x514F4920, "\x03\x71\x6F\x69\x66"}, // QOI {+0x504E4720, "\x03\x89\x50\x4E\x47"}, // PNG {+0x4A504547, "\x01\xFF\xD8"}, // JPEG }; diff --git a/test/data/README.md b/test/data/README.md index f805af2c..66a58055 100644 --- a/test/data/README.md +++ b/test/data/README.md @@ -11,6 +11,7 @@ ImageMagick's `convert` command line tool. The `*.wbmp` versions were generated by the `script/convert-png-to-wbmp.go` command line tool. The `*.webp` versions were generated by the cwebp command line tool. The `*.no-ancillary.png` files were generated by the `script/strip-png-ancillary-chunks.go` command line tool. +The `*.qoi` files were generated by the qoiconv command line tool. The `*.apng` files were generated by `gif2apng`. Those with finite animation loop counts were manually patched to correct for a `gif2apng` bug. diff --git a/test/data/bricks-color.qoi b/test/data/bricks-color.qoi new file mode 100644 index 00000000..cc8bd1b9 Binary files /dev/null and b/test/data/bricks-color.qoi differ