From a6d42c04a5e1b9802c9fd7b0d3ff4704f0ba06ab Mon Sep 17 00:00:00 2001 From: tannevaled Date: Thu, 27 Aug 2026 15:42:25 +0200 Subject: [PATCH] Hand back a fax as samples, not as the bytes it was compressed into reader v0.4.2 -> v0.5.0, which decodes /CCITTFaxDecode: Group 3 one-dimensional, Group 3 mixed, and Group 4. Images calls reader.Decode, so until now a scanned picture came back with Filter set to the fax name and Data holding bytes nobody downstream could read. Now Filter is empty and Data is samples, which is what the field has always said it means. Measured over all 2 268 forms in /Users/Shared/pdfforms, both binaries verified with `go version -m`: 74 of 2 268 files return a different inventory -- 71 of the 1 633 real documents, 3 of the 635 vendor fixtures. 2 861 images changed: 2 592 named /CCF and 269 /CCITTFaxDecode. Their data goes from 527 375 bytes still compressed to 12 708 706 bytes of samples. Nothing else moved: no DCTDecode or JPXDecode image changed, and no file changed which images it finds or whether it opens. Note for anyone switching on a filter name: reader.ImageFilter no longer answers true for /CCITTFaxDecode or /CCF. Nothing in this package calls it. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 472a3fa..e70e3ed 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.26.4 require ( github.com/go-opentype/opentype v0.9.0 github.com/go-pdfkit/pdffont v0.3.0 - github.com/go-pdfkit/reader v0.4.2 + github.com/go-pdfkit/reader v0.5.0 ) require github.com/go-opentype/fonts v0.8.0 diff --git a/go.sum b/go.sum index ba08934..bbd4fd0 100644 --- a/go.sum +++ b/go.sum @@ -4,5 +4,5 @@ github.com/go-opentype/opentype v0.9.0 h1:GFgcJ3nwTDp4NJr5O+Paw7lhZx5Jv/R+noZwvh github.com/go-opentype/opentype v0.9.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU= github.com/go-pdfkit/pdffont v0.3.0 h1:G5DKcAmsZJ0e17QhSrcUaL7PKEXKjUx4P/iGMl7bAbI= github.com/go-pdfkit/pdffont v0.3.0/go.mod h1:bfmNLna1l1CljNX/Utg55YzFylovfmI7sJnvgA3bzKI= -github.com/go-pdfkit/reader v0.4.2 h1:0/qPShLzdG/roH4i13dwDTHnS7mEBVTaCBGwCZQhOH0= -github.com/go-pdfkit/reader v0.4.2/go.mod h1:fQFOVfCMUui1AdvD4qhimdyvvNr9KvvJ1S7IuKZjyV8= +github.com/go-pdfkit/reader v0.5.0 h1:DaJ5C6eKXPRG9Cdu+olA/0KLmsQgyHEC1coteQQuBxU= +github.com/go-pdfkit/reader v0.5.0/go.mod h1:fQFOVfCMUui1AdvD4qhimdyvvNr9KvvJ1S7IuKZjyV8=