Skip to content

Commit

Permalink
Don't downscale by steps images which will end up with small dimensio…
Browse files Browse the repository at this point in the history
…ns (bug 1445735)
  • Loading branch information
calixteman committed May 28, 2023
1 parent 6d8810b commit b208794
Showing 1 changed file with 10 additions and 0 deletions.
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,
width,
height,
};
}

let paintWidth = width,
paintHeight = height;
let tmpCanvasId = "prescale1";
Expand Down

0 comments on commit b208794

Please sign in to comment.