mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Add a new parameter to JpegImage.getData
to indicate the source of the image data (issue 9513)
The purpose of this patch is to provide a better default behaviour when `JpegImage` is used to parse standalone JPEG images with CMYK colour spaces. Since the issue that the patch concerns is somewhat of a special-case, the implementation utilizes the already existing decode support in an attempt to minimize the impact w.r.t. code size. *Please note:* It's always possible for the user of `JpegImage` to control image inversion, and thus override the new behaviour, by simply passing a custom `decodeTransform` array upon initialization.
This commit is contained in:
parent
47bf12cbac
commit
663922f93f
3 changed files with 36 additions and 11 deletions
|
@ -97,8 +97,12 @@ let JpegStream = (function JpegStreamClosure() {
|
|||
const jpegImage = new JpegImage(jpegOptions);
|
||||
|
||||
jpegImage.parse(this.bytes);
|
||||
let data = jpegImage.getData(this.drawWidth, this.drawHeight,
|
||||
this.forceRGB);
|
||||
let data = jpegImage.getData({
|
||||
width: this.drawWidth,
|
||||
height: this.drawHeight,
|
||||
forceRGB: this.forceRGB,
|
||||
isSourcePDF: true,
|
||||
});
|
||||
this.buffer = data;
|
||||
this.bufferLength = data.length;
|
||||
this.eof = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue