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"
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.
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
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
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.
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
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