Commit Graph
3 Commits
Author SHA1 Message Date
Lilith River c3977c4513 test: expand test suite to 74 images with libtiff reference decoder
Add 19 new libtiff-generated test images and a reference decoder
(verify_seq_tiff.c) that independently verifies all checksums using
libtiff's own read path, giving three-way agreement:
  libtiff writer → libtiff reader → image-tiff reader

New coverage:
- Standard sub-byte: 1-bit, 2-bit, 4-bit grayscale (BIZ + WIZ)
- Multi-strip: RowsPerStrip=4 (gray 8/16, RGB 8)
- Tiled + compressed: LZW and Deflate tiles
- Float predictor: f32/f64 + Deflate + predictor=3
- Unassociated alpha: RGBA 8-bit with EXTRASAMPLE_UNASSALPHA
- Sub-byte RGB: 5-bit and 7-bit contiguous
- Signed RGB: i8 and i16 (3-channel, decoded as Multiband)
- Float f64 RGB
- Tiled BigTIFF

verify_seq_tiff.c: reads each TIFF with libtiff, computes matching
checksums (handling packed sub-byte, unpacked extended, float, signed),
and verifies 68/68 cases pass.

Total: 74 test images (66.8 KB), 317 tests all passing.
2026-03-10 06:02:19 -06:00
Lilith River a4cbf7bbaf test: add 28 format-variant test images covering compression, tiled, BigTIFF, float, signed, CMYK, palette, RGBA, multi-page, and big-endian
Expand gen_seq_tiff.c with writers for standard-depth formats that exercise
different decoder code paths. All 55 seq-* images are 16x16, libtiff-generated,
and cross-validated against tifffile.

New coverage:
- Compression: LZW, Deflate, PackBits (gray 8/16-bit, RGB 8-bit)
- LZW + horizontal predictor (8-bit gray)
- Tiled layout: gray 8/16-bit, RGB 8-bit (16x16 tiles)
- BigTIFF: gray 8-bit, RGB 16-bit
- Float: gray f32/f64, RGB f32
- Signed integer: i8, i16, i32
- CMYK: 8-bit, 16-bit
- Palette/indexed: 4-bit, 8-bit (with known colormap)
- RGBA with associated alpha: 8-bit, 16-bit
- Multi-page: 3-page gray 8-bit (all pages verified)
- Big-endian byte order: gray 8/16-bit, RGB 8-bit

Total: 298 tests, all passing.
2026-03-10 06:02:19 -06:00
Lilith River 26c32431fa test: regenerate seq-* test images using libtiff C API
Replace Python-generated test TIFFs with libtiff-generated ones to
eliminate circular validation. The C program (gen_seq_tiff.c) uses
libtiff's TIFFWriteScanline with MSB-first packed bit streams.

Cross-validated: tifffile independently confirms all 27 images match
the original Python-generated versions byte-for-byte. tiffinfo validates
all IFD structures. All 27 image-tiff decode tests pass unchanged.
2026-03-10 06:02:19 -06:00