pdf-rs / pdf

Rust library to read, manipulate and write PDF files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

None value for PNG filters

omkar-mohanty opened this issue · comments

While executing the read.rs example, I tried to extract images from a pdf with PNG images in it. The raw_image_data function returned None for filter , but shouldn't the correct returned filter be a FlateDecode ?

Sounds about right.

Could you adjust

pub fn raw_image_data(&self, resolve: &impl Resolve) -> Result<(Arc<[u8]>, Option<&StreamFilter>)> {
accordingly and make a PR?

Sure 👍 . I had a question though does using the raw_image_data on a PNG image return the IDAT chunk?

I don't think so. So you may have to do some reconstruction, and possibly add a as_png method that does this.