1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #8638 from Snuffleupagus/issue-4926-built-in-jpg

In `src/core/jpg.js`, ensure that the Adobe JPEG marker always takes precedence, even when the color transform code is zero
This commit is contained in:
Tim van der Meij 2017-07-22 17:25:09 +02:00 committed by GitHub
commit 7ded895d0c
3 changed files with 18 additions and 7 deletions

View file

@ -958,12 +958,13 @@ var JpegImage = (function JpegImageClosure() {
return data;
},
_isColorConversionNeeded: function isColorConversionNeeded() {
if (this.adobe && this.adobe.transformCode) {
// The adobe transform marker overrides any previous setting
return true;
} else if (this.numComponents === 3) {
if (!this.adobe && this.colorTransform === 0) {
_isColorConversionNeeded() {
if (this.adobe) {
// The adobe transform marker overrides any previous setting.
return !!this.adobe.transformCode;
}
if (this.numComponents === 3) {
if (this.colorTransform === 0) {
// If the Adobe transform marker is not present and the image
// dictionary has a 'ColorTransform' entry, explicitly set to `0`,
// then the colours should *not* be transformed.
@ -972,7 +973,7 @@ var JpegImage = (function JpegImageClosure() {
return true;
}
// `this.numComponents !== 3`
if (!this.adobe && this.colorTransform === 1) {
if (this.colorTransform === 1) {
// If the Adobe transform marker is not present and the image
// dictionary has a 'ColorTransform' entry, explicitly set to `1`,
// then the colours should be transformed.