Skip to content
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: Missing raw stream read/write #39900

Open
kpym opened this issue Jun 28, 2020 · 3 comments
Open

x/image/tiff: Missing raw stream read/write #39900

kpym opened this issue Jun 28, 2020 · 3 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@kpym
Copy link

kpym commented Jun 28, 2020

If I understand well the TIFF library only offers encode/decode but not raw read/write methods.

As TIFF is an image container that can support multiple encodings, IMO, it could be very useful to have direct read/write access to the encoded data stream. In this way for example a jpeg encoded image can be encapsulated in a TIFF container without decoding/encoding. The same is valid for CCITT or JBIG2 encodings.

This can also be very useful to extract images from PDF file and save them to TIFF without encoding/decoding. Or to make the inverse : import TIFF images to PDF files.

@bsiegert
Copy link
Contributor

/cc @nigeltao

A priori, I am open to such a thing. It might be a useful addition. What should the API look like? Similar to archive/tar maybe?

@kpym
Copy link
Author

kpym commented Jun 29, 2020

I have no precise idea about the API but may be something close to Encode/Decode like:

func Write(w io.Writer, p []byte, opt *Options) error

and

func Read(r io.Reader, p []byte) (n int, err error)

@dmitshur dmitshur added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 1, 2020
@dtrehas
Copy link

dtrehas commented Jan 19, 2022

Very useful for extracting images from old tiff (fax) documents in order be converted to pdf having small size (still in ccit 6 format).
Useful also for jbig2 tiffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants