pdf-rs/pdf

None value for PNG filters

omkar-mohanty opened this issue · 3 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 ?

s3bk commented

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?

s3bk commented

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