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 · 2 comments
Open

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

kpym opened this issue Jun 28, 2020 · 2 comments

Comments

@kpym
Copy link

@kpym 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

@bsiegert bsiegert commented Jun 29, 2020

/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 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants