Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't downscale by steps images which will end up with small dimensions (bug 1445735) #16482

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/bug1445735.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://bugzilla.mozilla.org/attachment.cgi?id=8958936
10 changes: 9 additions & 1 deletion test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7713,5 +7713,13 @@
"value": ["Three", "Five"]
}
}
}
},
{
"id": "bug1445735",
"file": "pdfs/bug1445735.pdf",
"md5": "a5470d82c1d23eac1fef2fa37f95e980",
"rounds": 1,
"link": true,
"type": "eq"
}
]