Open kpym opened 4 years ago
/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?
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)
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.
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.