TIFF: CCITT Group 3 compressed files open and place

1-bit TIFFs compressed with CCITT Group 3 did not open, place or
relink: the image decoder reads Group 4 only and refuses Compression 2
(modified Huffman) and Compression 3 (ITU-T T.4).

They are now decoded with hayro-ccitt, the CCITT decoder that EPS
import uses. Compression 2 rows start at a byte and have no EOL codes.
Compression 3 rows follow an EOL code and are one-dimensional, or, with
T4Options bit 0, one- or two-dimensional as each row's tag bit says.
Fill bits, FillOrder 2, either PhotometricInterpretation, strips and
tiles are read.

A file whose pixels would take more than the decoding allowance as
RGBA is refused as too large to draw. A strip or tile whose data ends
before its last row is refused as damaged, and so is a tile larger
than the allowance. The strips and tiles together are read from at
most as many bytes as the file holds.

Part of #1466.

Docs: docs/file-format-parity.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo authored and bflatastic committed 2026-10-18 01:21:30 +07:00
1 parent 8fbd515d6c
commit dd466d79e4
11 files changed
+500 -7

No files matched your search

Generated
+2
View File
@@ -4617,6 +4617,7 @@ dependencies = [
name = "vectorcraft-doc"
version = "0.12.0"
dependencies = [
"hayro-ccitt",
"image",
"jpeg-encoder",
"kurbo 0.13.1",
@@ -4883,6 +4884,7 @@ dependencies = [
name = "vectorcraft-testkit"
version = "0.12.0"
dependencies = [
"fax",
"image",
"kurbo 0.13.1",
"proptest",