New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/image/tiff: CCITT reader EOF error for tiff image #39705
Comments
/cc @nigeltao |
Hi @xajler! |
Change https://golang.org/cl/252037 mentions this issue: |
Thanks for looking into it, @hhrutter. |
Well, if I understand the spec correctly, missing EOLs are actually malformed CCITT images (or malformed TIFF images), and see also (https://en.wikipedia.org/wiki/Robustness_principle#Criticism). Two questions.
|
The failing TIFF opens up nicely with Mac Preview and ImageMagick does not seem to have any problem with it:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
With last
master
branch.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tiff file used to get an error debug_26428.zip (compressed with zip, extract it for usage). Length of tiff file is:
26428
bytes.I've created test cases that can be used for
tiff
andccitt
package. Because it is called withtiff.Decode()
, but error is inccitt.decodeEOL()
.tiff
Copy extracted tiff to root testdata and copy this test case to
tiff.reader_test.go
Output:
ccitt
Copy extracted tiff to
ccitt
testdata and copy this test toccitt.reader_test.go
Data taken from actual debugging for this file, when called with
tiff.Decode()
.Output:
What works for this case
I'm not even remotely expert on specs for TIFF and ccitt, but I've changed last return from
return errMissingEOL
toreturn nil
and I'm getting correct image and everything works fine and tried in many files (mostly all scanned textual with images, and all B/W) and I've see no problems with this fix/hack.Request
Can anybody see in TIFF provided, run this tests, maybe do better "fix". Because with this applied
ccitt
testTestRead
fails with output:Thanks
The text was updated successfully, but these errors were encountered: