Open Bug 1731483 Opened 3 years ago Updated 2 years ago

JPEG2000 images with unsupported COD options in PDFs not being shown in Firefox viewer

Categories

(Firefox :: PDF Viewer, defect)

Firefox 92
defect

Tracking

()

Tracking Status
firefox-esr91 --- wontfix
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- wontfix
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- wontfix

People

(Reporter: janreggie.delacruz, Unassigned)

References

Details

(Whiteboard: [pdfjs-image-jpx])

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

  1. Go to this Wikimedia Commons page: https://commons.wikimedia.org/wiki/File:Vida_y_escritos_del_Dr._Jos%C3%A9_Rizal,_por_Wenceslao_Retana.pdf
  2. Select "Original file", causing Firefox to load said PDF
  3. Went to page 7 and page 563

Actual results:

In page 7, there is a blank space below RESPECTIVAMENTE.
In page 563, nearly the entire page is blank, save some text on the right side, which serves as the caption for the "hidden" image.

Expected results:

In page 7, there should be an image below RESPECTIVAMENTE, displaying the logo of the printing press.
In page 563, there should be an image of a bill and a stamp.

The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → PDF Viewer

Hi Jan,
thank you for taking the time to submit this bug report.
I was able to reproduce on Windows 10, on Firefox Nightly 94.0a1 (2021-09-20) (64-bit) version and Release 92.0 (64-bit) version, as described in actual results. Based on this I will mark each respective flag as affected and set the severity.

I let the component in order to get the dev team involved, but if it's not relevant,
'Firefox-PDF Viewer' team, please feel free to change the component if this is not the appropriate one.

Jerónimo.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

Change the status for beta to have the same as nightly and release.
For more information, please visit auto_nag documentation.

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
I can confirm this bug with the nightly build.

It seems to be a problem with the embedded JPX image.

The console out put shows:

"Warning: Invalid absolute docBaseUrl: "file:///C:/Users/USER/Downloads/Vida_y_escritos_del_Dr._Jos%C3%A9_Rizal,_por_Wenceslao_Retana-2.pdf". pdf.worker.js:1115:13
PDF 63bc83946486db9b0effc08a20df93b9 [1.4 itext-paulo-155 (itextpdf.sf.net-lowagie.com) / pdftk-java 3.0.9] (PDF.js: 2.12.126) viewer.js:1502:13
Warning: JPX: Unsupported COD options (resetContextProbabilities, terminationOnEachCodingPass, verticallyStripe, predictableTermination). pdf.worker.js:1115:13
Warning: Unable to decode image "img_p6_2": "JpxError: JPX error: JPX error: Out of packets". pdf.worker.js:1115:13
Warning: Dependent image isn't ready yet pdf.js:925:13"

These COD options aren't supported:
https://github.com/mozilla/pdf.js/blob/de7cfed9e392eb3bfcb761ccea2c1f09cdf869aa/src/core/jpx.js#L337-L355
:jrmuizel, do you know someone who could help to implement that stuff ?

Flags: needinfo?(jmuizelaar)

Calixte, I don't really know anyone who's familiar with jpeg2000 to suggest. If it's important we could come up with someone though. Perhaps one of the Outreachy people would be an option?

I implemented one of the easy options for fun. Maybe I'd look at the others when some free time shows up.

Flags: needinfo?(jmuizelaar)

terminationOnEachCodingPass is probably a good one to implement next

:jrmuizel, would you mind to make a PR with your patch in pdf.js repo ?

(In reply to Calixte Denizet (:calixte) from comment #10)

:jrmuizel, would you mind to make a PR with your patch in pdf.js repo ?

Needinfo for the above question ^

Flags: needinfo?(jmuizelaar)
Whiteboard: [pdfjs-image-jpx]
Attachment #9251064 - Attachment is patch: true
Attachment #9251064 - Attachment mime type: application/octet-stream → text/plain
Summary: Images in PDFs not being shown in Firefox viewer → JPEG2000 images with unsupported COD options in PDFs not being shown in Firefox viewer

Jonas submitted the patch, thanks Jonas!

Flags: needinfo?(jmuizelaar)
Commit merged into master by GitHub Authored by calixteman (calixteman)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: