mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Fixes masked JPEG image
This commit is contained in:
parent
2b6067c040
commit
6b411b559d
3 changed files with 13 additions and 11 deletions
|
@ -536,12 +536,12 @@ var PDFImage = (function PDFImageClosure() {
|
|||
}
|
||||
return imgData;
|
||||
}
|
||||
}
|
||||
if (this.image instanceof JpegStream) {
|
||||
imgData.kind = ImageKind.RGB_24BPP;
|
||||
imgData.data = this.getImageBytes(originalHeight * rowBytes,
|
||||
drawWidth, drawHeight);
|
||||
return imgData;
|
||||
if (this.image instanceof JpegStream && !this.smask && !this.mask) {
|
||||
imgData.kind = ImageKind.RGB_24BPP;
|
||||
imgData.data = this.getImageBytes(originalHeight * rowBytes,
|
||||
drawWidth, drawHeight, true);
|
||||
return imgData;
|
||||
}
|
||||
}
|
||||
|
||||
imgArray = this.getImageBytes(originalHeight * rowBytes);
|
||||
|
@ -629,10 +629,12 @@ var PDFImage = (function PDFImageClosure() {
|
|||
},
|
||||
|
||||
getImageBytes: function PDFImage_getImageBytes(length,
|
||||
drawWidth, drawHeight) {
|
||||
drawWidth, drawHeight,
|
||||
forceRGB) {
|
||||
this.image.reset();
|
||||
this.image.drawWidth = drawWidth;
|
||||
this.image.drawHeight = drawHeight;
|
||||
this.image.drawWidth = drawWidth || this.width;
|
||||
this.image.drawHeight = drawHeight || this.height;
|
||||
this.image.forceRGB = !!forceRGB;
|
||||
return this.image.getBytes(length);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1012,7 +1012,7 @@ var JpegImage = (function jpegImage() {
|
|||
} else {
|
||||
return this._convertYcckToCmyk(data);
|
||||
}
|
||||
} else {
|
||||
} else if (forceRGBoutput) {
|
||||
return this._convertCmykToRgb(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -901,7 +901,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|||
|
||||
jpegImage.parse(this.bytes);
|
||||
var data = jpegImage.getData(this.drawWidth, this.drawHeight,
|
||||
/* forceRGBoutput = */true);
|
||||
this.forceRGB);
|
||||
this.buffer = data;
|
||||
this.bufferLength = data.length;
|
||||
this.eof = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue