diff --git a/bug1445735.pdf b/bug1445735.pdf new file mode 100644 index 00000000000000..49fa49a9b1dba5 Binary files /dev/null and b/bug1445735.pdf differ diff --git a/src/display/canvas.js b/src/display/canvas.js index 8bf1a2de11785a..9af9b3054f542a 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1188,6 +1188,16 @@ class CanvasGraphics { 1 ); + if (width / widthScale <= 5 && height / heightScale <= 5) { + // The final image is very small, hence having a poor quality + // when rescaling isn't really a problem. + return { + img, + paintWidth: width, + paintHeight: height, + }; + } + let paintWidth = width, paintHeight = height; let tmpCanvasId = "prescale1"; diff --git a/test/pdfs/bug1445735.pdf.link b/test/pdfs/bug1445735.pdf.link new file mode 100644 index 00000000000000..de8f83e76816e8 --- /dev/null +++ b/test/pdfs/bug1445735.pdf.link @@ -0,0 +1 @@ +https://bugzilla.mozilla.org/attachment.cgi?id=8958936 diff --git a/test/test_manifest.json b/test/test_manifest.json index 72e2e102c6826d..0850b88f3c2aa3 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -7683,5 +7683,13 @@ "md5": "4830e765a3d6cb64d39b84de11178f6e", "rounds": 1, "type": "eq" + }, + { + "id": "bug1445735", + "file": "pdfs/bug1445735.pdf", + "md5": "a5470d82c1d23eac1fef2fa37f95e980", + "rounds": 1, + "link": true, + "type": "eq" } ]