ydc1992 / peepdf

Automatically exported from code.google.com/p/peepdf
GNU General Public License v3.0
0 stars 1 forks source link

PNG prediction decode only decodes part of the image #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When using PDFs containing PNG images with prediction > 10, the current 
implementation only decodes part of the image (1/3 of each row of the image).

Luckily, I already found the problem and I will attach a patch with a possible 
solution :)

Original issue reported on code.google.com by chirila....@gmail.com on 17 Sep 2013 at 9:55

Attachments:

GoogleCodeExporter commented 8 years ago
The problem was that in:

for i in range(1, numSamplesPerRow):
    # apply reverse prediction to current scanline (bytes)

numSamplesPerRow contained the number of sample, but the actual number of bytes 
are 
numSamplesPerRow * bytesPerSample + 1, so if bytesPerSample was 3 (as it was in 
my case), only a third of the image would get decoded.

Original comment by chirila....@gmail.com on 17 Sep 2013 at 10:00

GoogleCodeExporter commented 8 years ago
Hi! 

Thanks for the feedback! Could you attach or send me a PDF sample to work with 
it and verify the problem, please?

Thanks!

Original comment by josemigu...@gmail.com on 18 Sep 2013 at 10:01