mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.33k stars 9.97k forks source link

Images not rendering due to quantizationTables missing at rendering phase #7406

Closed flexpaper closed 8 years ago

flexpaper commented 8 years ago

Link to PDF file (or attach file here):

Configuration: broken-image.pdf

Steps to reproduce the problem:

  1. Open PDF
  2. Observe no images appearing

What is the expected behavior? (add screenshot) Images appearing (they are appearing in OSX Preview, Adobe Acrobat, Chrome PDFium)

What went wrong? (add screenshot) This seems related to reading the quantizationTables in the parse function of JpegImage. It looks like the quantizationTables are parsed after they are used which is causing them to be empty. Could this be a matter of rendering order for these tables?

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

Snuffleupagus commented 8 years ago

@flexpaper Are you the creator of the PDF file, and if so may we include it in the test-suite?

Please note: I've submitted a tentative patch, but we really need to be able to include a test-case with the patch in order to land it.

flexpaper commented 8 years ago

Many thanks for the tentative patch - I am not the author of this particular pdf so I can't give that permission unfortunately :( I'll try to create a new sample for you that you can use for your suite

timvandermeij commented 8 years ago

I think we'll have to try to make a reduced test case out of the posted PDF somehow.