mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Use the *full* inline image as the cacheKey in Parser.makeInlineImage
(bug 1799927)
*Please note:* This only fixes the "wrong letter" part of bug 1799927. It appears that the simple `computeAdler32` function, used when caching inline images, generates hash collisions for some (very short) TypedArrays. In this case that leads to some of the "letters", which are actually inline images, being rendered incorrectly. Rather than switching to another hashing algorithm, e.g. the `MurmurHash3_64` class, we simply cache using a stringified version of the inline image data as the cacheKey to prevent any future collisions. While this will (naturally) lead to slightly higher peak memory usage, it'll however be limited to the current `Parser`-instance which means that it's not persistent. One small benefit of these changes is that we can avoid creating lots of `Stream`-instances for already cached inline images.
This commit is contained in:
parent
f7449563ef
commit
b46e0d61cf
4 changed files with 28 additions and 29 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -534,6 +534,7 @@
|
|||
!issue14415.pdf
|
||||
!issue14307.pdf
|
||||
!issue14497.pdf
|
||||
!bug1799927.pdf
|
||||
!issue14502.pdf
|
||||
!issue13211.pdf
|
||||
!issue14627.pdf
|
||||
|
|
BIN
test/pdfs/bug1799927.pdf
Normal file
BIN
test/pdfs/bug1799927.pdf
Normal file
Binary file not shown.
|
@ -5921,6 +5921,12 @@
|
|||
"annotations": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "bug1799927",
|
||||
"file": "pdfs/bug1799927.pdf",
|
||||
"md5": "e6ad013c24e58e5b40c3bae50f04c8e8",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "annotation-line-without-appearance-empty-Rect",
|
||||
"file": "pdfs/annotation-line-without-appearance-empty-Rect.pdf",
|
||||
"md5": "65f2d3ef80acfea637718c3fc66043b7",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue