lopdf
lopdf copied to clipboard
Cannot decode LZWDecode
Here is TIFF 6 spec which uses LZWDecode: https://web.archive.org/web/20180810205359/https://www.adobe.io/content/udp/en/open/standards/TIFF/_jcr_content/contentbody/download/file.res/TIFF6.pdf
Stream::decompress_lzw
fails with:
Custom { kind: InvalidData, error: "InvalidCode" }
I'm not sure if this is weezl
error or lopdf
, because older lzw
version of lopdf
fails too.
the following code I ran using the TIFF6.pdf
fn get_mut() -> Result<bool> {
let mut doc = Document::load("assets/TIFF6.pdf")?;
doc.save("assets/TIFF_saved.pdf")?;
Ok(true)
}
It loaded the document successfully and saved it to without Error. So I suspect it was a weezl bug and this can be closed @J-F-Liu @RazrFalcon
lopdf
simply ignores weezl
errors:
https://github.com/J-F-Liu/lopdf/blob/6b04581640e061bfeb39b585e50a7e9d102b8fe2/src/object.rs#L604
can you show me how your loading the file to run into this issue?
I'm not "loading" it, I was just testing this crate and saw a warning in the log.