1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 09:08:07 +02:00

Render large images even if they're larger than the canvas limits (bug 1720282)

The idea is to encode large image in BMP format (which is very simple and doesn't
require to compute any checksums) and then use createImageBitmap with a BMP blob
(which doesn't suffer of the Canvas/ImageData limits).
From a performance point of view, it isn't crazy (generating a large blob + decoding
it on the main thread is really not ideal) but at least we've something to display
which is a way better than a blank page (and one can notice that most of the time is
spent in decoding the image from the pdf stream).
This commit is contained in:
Calixte Denizet 2023-02-20 17:35:41 +01:00
parent d7e4be9cdb
commit 05b0c9d7e6
6 changed files with 457 additions and 11 deletions

View file

@ -0,0 +1,2 @@
https://github.com/mozilla/pdf.js/files/57455/DC000933-uncompressed.pdf

View file

@ -0,0 +1,2 @@
https://github.com/mozilla/pdf.js/files/1135236/eID_Broschuere-page16.pdf

View file

@ -7378,5 +7378,21 @@
"md5": "1eec7137e471a3d68a20855a04293b5b",
"link": true,
"type": "other"
},
{
"id": "issue6741",
"file": "pdfs/issue6741.pdf",
"md5": "ddbe6ccc7ae414c7ffa6c4110536730d",
"rounds": 1,
"link": true,
"type": "eq"
},
{
"id": "issue8076",
"file": "pdfs/issue8076.pdf",
"md5": "4a866bff4209956a6cfa2e2c9456f421",
"rounds": 1,
"link": true,
"type": "eq"
}
]