old.reddit.com/r/anime/comments/1ejvd6l/ranime_karma_ranking_discussion_week_5_summer_2024/lghf95e/ - Huge PDF file generated (due to cairo gradients)
Categories
(Core :: Printing: Output, defect, P3)
Tracking
()
People
(Reporter: railioaie, Unassigned)
References
()
Details
Attachments
(1 file)
489 bytes,
text/html
|
Details |
Environment:
Operating System: Linux
Firefox version: Nightly 131.0a1 (2024-08-05)
Preconditions:
Clean profile
ETP set to Strict
Steps to reproduce:
-
Navigate to: https://old.reddit.com/r/anime/comments/1ejvd6l/ranime_karma_ranking_discussion_week_5_summer_2024/lghf95e/
-
Press CTRL+P
-
Unselect "Print backgrounds" = gives small PDF of 118 KB, opens OK
-
Select "Print backgrounds" to include pictures: gives PDF file of ~170 MB, which Okular can not show (maybe freezes trying to render).
-
Print the same page using Chrome with pictures = gives PDF file of 1.6 MB size, opens OK
Expected Behavior:
The document is saved correctly
Actual Behavior:
The file is saved in very different dimensions FF vs Chrome(1.6 MB vs 170 MB)
Notes:
- Screenshot attached
- Reproducible on the latest build of Firefox Nightly and Release
- Not reproducible on Chrome
Comment 1•6 months ago
|
||
Looks like Chrome might be doing some compression on background images or something? Moving to the printing folks to take a look.
Comment 2•6 months ago
|
||
Hm, I extracted the images saved into PDFs from Firefox and Chrome using pdfimages
- they are of similar sizes. If anything, PDF from Firefox have a smaller total image size. It did take forever with the Firefox PDF, but well, it's huge, and there was no any warning/error message.
Another interesting fact - File info claims this massive PDF page to be 2 pages long, despite the fact that the preview shows 6 pages (Which matches Chrome).
I also see the following console output:
[GFX3-]: Surface size too large (exceeds extent limit)!
[GFX2-]: Allowing surface with invalid size (Cairo) Size(48960,63360)
[GFX3-]: Surface size too large (exceeds extent limit)!
[GFX2-]: Allowing surface with invalid size (Cairo) Size(48960,63360)
[GFX3-]: Surface size too large (exceeds extent limit)!
[GFX2-]: Allowing surface with invalid size (Cairo) Size(48960,63360)
[GFX3-]: Surface size too large (exceeds extent limit)!
[GFX2-]: Allowing surface with invalid size (Cairo) Size(48960,63360)
Comment 3•6 months ago
|
||
The severity field is not set for this bug.
:boris, could you have a look please?
For more information, please visit BugBot documentation.
Comment 4•5 months ago
|
||
Here's a profile: https://share.firefox.dev/3B1yf5p
It seems Cairo's gradient rendering is exploding badly. Jonathan, does this ring a bell?
Comment 5•5 months ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
Here's a profile: https://share.firefox.dev/3B1yf5p
It seems Cairo's gradient rendering is exploding badly. Jonathan, does this ring a bell?
Not really; but it wouldn't surprise me if there are cases where cairo decides it doesn't know how to express a gradient "natively" in the pdf output, and falls back to generating a (huge) rasterized representation.
I see a somewhat milder version of the issue on macOS, too (which has a very different cairo backend): without backgrounds, I get a 452K pdf, while with backgrounds included it explodes to 46.4MB. Chrome's version (with backgrounds) is 1.7MB.
It'd be interesting to identify the specific image or images that trigger this.
Comment 6•5 months ago
|
||
This generates a > 10 MiB PDF file.
Description
•