-
Notifications
You must be signed in to change notification settings - Fork 18k
x/image/tiff: package doesn't support CCITT Fax 4 Compression #19443
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
Comments
@sanbornm would it be possible for you to provide a sample offending image and a working repro program? It makes it easier for folks to investigate. Thanks. |
Output:
|
I am having similar issue -
Here is a sample image |
I can contribute an enhanced version of x/image/tiff that features:
Right now it's all located at pdfcpu. |
CCITT Fax compression seemed unlikely to be useful when this was written. Sure, please send CLs to me :) |
Kind of unreal to get feedback after 6 months. |
Yes, and I did not see this in time.
Horst Rutter <[email protected]> schrieb am Sa. 13. Apr. 2019 um
20:47:
Kind of unreal to get feedback after 6 months.
@bsiegert <https://github.com/bsiegert> are you one of the maintainers of
this package?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19443 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA04Gr7c7M01TFhLfKgxHT4iFQRHedTQks5vgiZfgaJpZM4MVrHc>
.
--
Benny
|
Excellent! Please have a look at here and here and let me know how to proceed. There are dependencies on compress/lzw which I improved and started a golang proposal for and Meanwhile I am busy resolving this pdfcpu issue. |
Ah.... good to see progress here, I started some work for a t.4 and t.6 decoder (just for fun) as the issue seemed to be well asleep. |
@hhrutter Maybe let's start with CCITT Fax G4 compression. You say you have code for that? Have you ever contributed to Go? If not, see https://golang.org/doc/contribute.html for how to get started. Send a CL for golang/image (golang.org/x/image) and start the commit message with "tiff: ". You can set @nigeltao and me as the reviewers. Alternatively, you can start a pull request on github, which will create a Gerrit CL. This is a bit more clunky though. |
I have a rudimentary decoder for G3 and G4 that I can contribute. I did not write the encoder yet because these days CCITT G3/G4 encoding does not seem to have that much priority for users like CCITT decoding. Please let me know if you accept a CCITT reader without the corresponding writer. I am aware having a Reader/Writer pair enables writing nice tests. Another sub issue would be finding the right location for a There is Other than that I think I am setup for contributing. I signed up with Gerrit a year ago although no contribution yet. |
Yes, that's fine. For example,
Yeah, that could be tricky. We'd probably want to check in some test files into the repo, but be aware of any copyright concerns with those files. Ideally we'd find some files with e.g. a Creative Commons or equally liberal license, or create your own test files (either manually, or transforming your own images through some other program such as ImageMagick).
I'm not so familiar with CCITT. |
I saw that LOC (Library of Congress) has some interest in TIFF preservation: There are images available with different compression embedded: I tried to find also "reference files" from ITU-T specifically for T.4 and T.6 but didn't find any. |
Regarding the ccitt package location. Thanks for the pointer to the library of congress ftp server. |
@hhrutter No one said that it should be part of I don't understand these two bits:
Is that a reason for not working on it?
Are you suggesting that the tiff package should not be extended? |
Change https://golang.org/cl/174139 mentions this issue: |
To the contrary. Let me give you some background: The same applies to lzw. There is the PDF LZWDecode filter. When I say there is a lot of work needed on the tiff package one In order to make progress it really helps to get familiar with the structure laid out in pdfcpu. It goes like: github.com/hhrutter/pdfcpu My wishlist is to to get rid of: also for the sake of a better project package structure. I am not saying it has to be that way but this is how I envision it. For now I can see 2 issues that need to be addressed simultaneously:
Later we need to and on top of that I can contribute And we definitely need to have the CCITT decoding/encoding in a seperate package from tiff. I already submitted what I am proposing. |
Change https://golang.org/cl/174979 mentions this issue: |
This initial commit only provides a decoder that generates modes and run lengths from a bit stream. Future commits will add more features. Updates golang/go#19443 Change-Id: I7bba1226a69a83e636e407e4d72ffd5630562e6b Reviewed-on: https://go-review.googlesource.com/c/image/+/174979 Reviewed-by: Benny Siegert <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Change https://golang.org/cl/182219 mentions this issue: |
The testdata/bw-gopher.png image was derived from testdata/bw-uncompressed.tiff The testdata/*ccitt* data was generated from a custom CCITT encoder: https://go-review.googlesource.com/c/image/+/174139/10/ccitt/writer.go Updates golang/go#19443 Change-Id: I53b7acd807aa9a627517ede5bc3316d6f1fe4724 Reviewed-on: https://go-review.googlesource.com/c/image/+/182219 Reviewed-by: Benny Siegert <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The algorithm is described at https://www.itu.int/rec/T-REC-T.6/en Fixes golang/go#19443 Change-Id: Ib8a078ab43c78d1f58d2ac849ed455b05dc209e9 Reviewed-on: https://go-review.googlesource.com/c/image/+/174139 Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Run-TryBot: Benny Siegert <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8 darwin/amd64
What operating system and processor architecture are you using (
go env
)?Darwin/amd64
What did you do?
Take a tiff image with
CCITT Fax 4 Compression
and attempt to decode it with the golang.org/x/image/tiff package.What did you expect to see?
I expected a level 4 compressed tiff to decode properly.
What did you see instead?
tiff: unsupported feature: compression value 4
The text was updated successfully, but these errors were encountered: