1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Enable/disable image smoothing based on image interpolate value. (bug 1722191)

While some of the output looks worse to my eye, this behavior more
closely matches what I see when I open the PDFs in Adobe acrobat.

Fixes: #4706, #9713, #8245, #1344
This commit is contained in:
Brendan Dahl 2021-09-08 17:31:10 -07:00
parent 8a79f13e5a
commit f38fb42b42
13 changed files with 74 additions and 9 deletions

View file

@ -139,7 +139,7 @@ class PDFImage {
this.width = width;
this.height = height;
this.interpolate = dict.get("Interpolate", "I") || false;
this.interpolate = dict.get("Interpolate", "I");
this.imageMask = dict.get("ImageMask", "IM") || false;
this.matte = dict.get("Matte") || false;
@ -294,6 +294,7 @@ class PDFImage {
height,
imageIsFromDecodeStream,
inverseDecode,
interpolate,
}) {
if (
typeof PDFJSDev === "undefined" ||
@ -339,7 +340,7 @@ class PDFImage {
}
}
return { data, width, height };
return { data, width, height, interpolate };
}
get drawWidth() {
@ -593,6 +594,7 @@ class PDFImage {
const imgData = {
width: drawWidth,
height: drawHeight,
interpolate: this.interpolate,
kind: 0,
data: null,
// Other fields are filled in below.