Merge pull request #15251 from Snuffleupagus/thumbnail-setImage-small
Ignore too small page-canvases in `PDFThumbnailView.setImage`
This commit is contained in:
commit
f9c593d66c
@ -352,13 +352,17 @@ class PDFThumbnailView {
|
||||
if (this.renderingState !== RenderingStates.INITIAL) {
|
||||
return;
|
||||
}
|
||||
const { thumbnailCanvas: canvas, pdfPage } = pageView;
|
||||
const { thumbnailCanvas: canvas, pdfPage, scale } = pageView;
|
||||
if (!canvas) {
|
||||
return;
|
||||
}
|
||||
if (!this.pdfPage) {
|
||||
this.setPdfPage(pdfPage);
|
||||
}
|
||||
if (scale < this.scale) {
|
||||
// Avoid upscaling the image, since that makes the thumbnail look blurry.
|
||||
return;
|
||||
}
|
||||
this.renderingState = RenderingStates.FINISHED;
|
||||
this._convertCanvasToImage(canvas);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user