Commit Graph
3551 Commits
Author SHA1 Message Date
Nigel Tao e9cb3c8b34 Use hd consistently, not xxd, in docs 2022-04-30 13:20:08 +10:00
Nigel Tao 7eaf488bae Fix gifplayer for still images with 0 loop count 2022-04-06 17:45:58 +10:00
Nigel Tao 03fd43cfcc Add "#png: unsupported CgBI extension" status 2022-03-21 14:12:25 +11:00
Nigel Tao a55e0a02a2 Fix test/c/std/json.c -Wunused-but-set-variable 2022-02-08 22:08:14 +11:00
Nigel Tao 23c9de18c6 Update doc/std/image-decoders.md Metadata for v0.3
Fixes #60
2022-02-06 21:38:41 +11:00
Nigel Tao 9719073707 Fix test/c/testlib 'const char *' vs 'char *'
Prior to this commit, `g++ test/c/std/png.c` failed with:
test/c/std/../testlib/testlib.c:107:14: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
...
test/c/std/../testlib/testlib.c:741:5: note: in expansion of macro ‘RETURN_FAIL’
  741 |     RETURN_FAIL("hex_dump: NULL argument");

Likewise, clang++ also failed with:
test/c/std/../testlib/testlib.c:741:5: error: cannot initialize return object of type 'char *' with an rvalue of type 'const char *'
    RETURN_FAIL("hex_dump: NULL argument");

Also run "clang-format-9 -style=Chromium"
2022-02-06 14:31:28 +11:00
Nigel Tao 94736e2eae Add "API Listing" sections to doc/std 2022-02-06 13:38:21 +11:00
Nigel Tao e4d237df89 Add std/tga to doc/std
Updates #67
2022-02-06 13:30:46 +11:00
Nigel Tao dd9679b56e Remove some redundant assignments after yields 2022-01-25 21:33:19 +11:00
Nigel Tao 7b51266642 Remove redundant json decode_comment "while true" 2022-01-25 21:26:27 +11:00
Nigel Tao 5a93c63f0a Tweak json.decoder.decode_comment 2022-01-25 21:24:54 +11:00
Nigel Tao 656c0bdf92 Remove some redundant assignments after yields 2022-01-25 20:37:50 +11:00
Nigel Tao b374b2b34f Tweak json decode_trailer whitespace_length var 2022-01-25 20:36:10 +11:00
Nigel Tao ad46513ded Remove some redundant assignments after yields 2022-01-25 20:25:46 +11:00
Nigel Tao 97eb1290f5 Tweak liveness analysis for if-else chains 2022-01-25 19:40:22 +11:00
Nigel Tao 14f5859311 Prohibit iterate loops inside coroutines 2022-01-25 15:22:56 +11:00
Nigel Tao 79ce1a7b0e Clear livenesses after jumps and returns 2022-01-25 15:04:07 +11:00
Nigel Tao 5ecd84e0ed Have std/png partially decode invalid images 2022-01-25 14:36:31 +11:00
Nigel Tao a4b14a0f17 Simpify std/png "yield short read" loop 2022-01-25 14:29:18 +11:00
Nigel Tao 63d8564b3c Tweak liveness analysis for "while true" loops 2022-01-25 14:21:49 +11:00
Nigel Tao 84d0576419 Tweak liveness analysis for return statements 2022-01-25 14:15:32 +11:00
Nigel Tao 6614ed0e90 Tweak liveness analysis for while loops 2022-01-25 13:58:37 +11:00
Nigel Tao 54646d826d Fix liveness analysis typo for break/continue 2022-01-25 12:56:48 +11:00
Nigel Tao d53f37997f Have std/png decode truncated images
Fixes #71
2022-01-23 22:59:06 +11:00
Nigel Tao 985a756a48 Add test/data/hippopotamus.*.truncated.png 2022-01-23 22:17:59 +11:00
Nigel Tao fa1bf3415e Add std/tga benchmarks
Updates #67
2022-01-21 16:13:07 +11:00
Nigel Tao 48e457204f Add "./build-{example,fuzz}.sh" instructions 2022-01-19 14:58:40 +11:00
Nigel Tao 418847fe94 wuffs gen -version=0.3.0-beta.14 v0.3.0-beta.14 2022-01-19 11:04:21 +11:00
Nigel Tao adfd2965cc Merge pull request #70 from MichaelMcDonnell/fix-rust-png-bench
Fix Rust PNG benchmark
2022-01-18 12:31:29 +11:00
Michael Mc Donnell 3fa3928c68 Fix Rust PNG benchmark
The Rust PNG benchmark no longer compiles. This is similar to the issue
that was fixed in pull request #68 for the Rust GIF benchmark. A new
version of the png crate was published that broke clean builds. I've
pinned the version to 0.17, which is the newest, and changed the code to
use the new API.

NOTE: Parts of the png crate documentation hasn't been updated to
correctly list the new transformation defaults. The documentation for
the `normalize_to_color8` method does say that the defaults changed from
version 0.16 to 0.17.
2022-01-17 13:36:18 -08:00
Nigel Tao 03e6188bea Add Michael Mc Donnell to A+C 2022-01-16 08:34:57 +11:00
Nigel Tao 2f61d7dbd4 Merge pull request #68 from MichaelMcDonnell/fix-rust-gif-bench
Fix Rust GIF benchmark
2022-01-16 08:32:14 +11:00
Nigel Tao c203818556 Have std/tga ignore X-Origin and Y-Origin fields
Updates #67
2022-01-15 15:10:03 +11:00
Nigel Tao 6d35660651 Add fuzz/c/std/tga_fuzzer.c
Updates #67
2022-01-15 14:53:41 +11:00
Nigel Tao c82793a984 Tighten magic_number_guess_fourcc TGA heuristic
Prior to this commit, test/data/cbor-rfc-7049-examples.cbor was
incorrectly sniffed as TGA. /usr/bin/file did this too.

$ file test/data/cbor-rfc-7049-examples.cbor
test/data/cbor-rfc-7049-examples.cbor: Targa image data - Map 59395 x 26
x 15 +6169 +6500 - 2-bit alpha - interleave "@\033"

Updates #67
2022-01-15 14:32:51 +11:00
Nigel Tao ed4d556721 Re-create test/data/bricks-gray.tga
We now convert it from the BMP file, not the PNG file:
$ convert bricks-gray.bmp -auto-orient bricks-gray.tga

The bricks-gray.png file has some gamma correction metadata that meant
that the previous TGA file (when converted to NIA) didn't match the
other bricks-gray.* files. After this commit, they all match:

$ grep bricks-gray test/nia-checksums-of-data.txt
c2bce675 test/data/bricks-gray.bmp
c2bce675 test/data/bricks-gray.gif
c2bce675 test/data/bricks-gray.no-ancillary.png
c2bce675 test/data/bricks-gray.png
c2bce675 test/data/bricks-gray.tga

Updates #67
2022-01-15 14:18:36 +11:00
Nigel Tao fd69133c5d Fix std/tga opaque-ness
Updates #67
2022-01-15 14:11:56 +11:00
Nigel Tao f4002c5b21 Have std/tga decode RLE images
Updates #67
2022-01-15 14:10:05 +11:00
Nigel Tao fc77dc35ff Have std/tga decode BGRX5551 images
Updates #67
2022-01-15 12:53:24 +11:00
Nigel Tao c997066a2a Have std/tga decode color-mapped images
Updates #67
2022-01-15 12:38:21 +11:00
Nigel Tao 2c10bc32b0 Have std/tga decode non-color-mapped images
Updates #67
2022-01-15 11:37:45 +11:00
Nigel Tao 5aa7a9339f Have std/tga decode width and height
Updates #67
2022-01-15 08:28:53 +11:00
Michael Mc Donnell d17fc6e6eb Fix Rust GIF benchmark
The Rust GIF benchmark no longer compiles. The Cargo.toml file uses a
star to specify the gif crate version. That means a clean compile will
use the latest version even if it has breaking changes. Version 0.11 has
breaking changes which means the benchmark can no longer be compiled
from a clean start.

I fixed the benchmark by pinning the version to 0.11 and updating the
code to use the new API.
2022-01-14 11:01:11 -08:00
Nigel Tao 4c09c77bb9 Add std/tga package
This is just a placeholder decoder implementation  (and all of the
required plumbing) that produces a 1x1 reddish-purple image. Follow-up
commits will add flesh to the metaphorical bones.

TGA has no magic identifier, so MIME sniffers have to use heuristics.
The test/data/cbor-rfc-7049-examples.cbor file (which is CBOR binary
data, not a TGA image) is mistakenly sniffed as TGA. The /usr/bin/file
program makes the same classification (a false positive).

$ file test/data/cbor-rfc-7049-examples.cbor
test/data/cbor-rfc-7049-examples.cbor: Targa image data - Map 59395 x 26
x 15 +6169 +6500 - 2-bit alpha - interleave "@\033"

Some test/3pdata/tgasuite/*.tga test files, which are invalid TGA
images, are also false positives for now.

Updates #67
2022-01-14 22:53:20 +11:00
Nigel Tao db0a5a4f3a Tweak NIE/NII/NIA recommended MIME types 2022-01-14 16:41:51 +11:00
Nigel Tao 15c174634e Fix test/data/*.tga orientation
This re-ran imagemagick's convert program, but this time with an
"-auto-orient" option. See
https://issueexplorer.com/issue/ImageMagick/ImageMagick/3844

for i in {color,gray,nodither}; do \
  convert bricks-$i.png -auto-orient bricks-$i.tga; \
  done

The test/data/*.tga files only change in their 18th bytes, from 0x00
(bottom-to-top) to 0x20 (top-to-bottom).

Updates #67
2022-01-14 16:40:05 +11:00
Nigel Tao 510f4581c6 Add test/3pdata/tgasuite
Updates #67
2022-01-14 15:43:28 +11:00
Nigel Tao 792d05bd9c Have magic_number_guess_fourcc use prefix_closed 2022-01-14 15:26:21 +11:00
Nigel Tao e5ead0218e Rename the magic-submodule "prefix" arguments 2022-01-14 15:16:20 +11:00
Nigel Tao f0412122be Add magic_number_guess_fourcc prefix_closed arg 2022-01-14 15:12:14 +11:00