Only set transform when its a non default.
This commit is contained in:
parent
9538da2b58
commit
7bf5daa273
@ -803,8 +803,8 @@ var JpegStream = (function JpegStreamClosure() {
|
|||||||
// need to be removed
|
// need to be removed
|
||||||
this.dict = dict;
|
this.dict = dict;
|
||||||
|
|
||||||
this.colorTransform = dict.get('ColorTransform') || -1;
|
|
||||||
this.isAdobeImage = false;
|
this.isAdobeImage = false;
|
||||||
|
this.colorTransform = dict.get('ColorTransform') || -1;
|
||||||
|
|
||||||
if (isAdobeImage(bytes)) {
|
if (isAdobeImage(bytes)) {
|
||||||
this.isAdobeImage = true;
|
this.isAdobeImage = true;
|
||||||
@ -822,6 +822,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|||||||
if (this.bufferLength)
|
if (this.bufferLength)
|
||||||
return;
|
return;
|
||||||
var jpegImage = new JpegImage();
|
var jpegImage = new JpegImage();
|
||||||
|
if (this.colorTransform != -1)
|
||||||
jpegImage.colorTransform = this.colorTransform;
|
jpegImage.colorTransform = this.colorTransform;
|
||||||
jpegImage.parse(this.bytes);
|
jpegImage.parse(this.bytes);
|
||||||
var width = jpegImage.width;
|
var width = jpegImage.width;
|
||||||
@ -858,7 +859,8 @@ var JpegStream = (function JpegStreamClosure() {
|
|||||||
JpegStream.prototype.isNativelyDecodable = function isNativelyDecodable(xref,
|
JpegStream.prototype.isNativelyDecodable = function isNativelyDecodable(xref,
|
||||||
res) {
|
res) {
|
||||||
var cs = ColorSpace.parse(this.dict.get('ColorSpace'), xref, res);
|
var cs = ColorSpace.parse(this.dict.get('ColorSpace'), xref, res);
|
||||||
if (cs.numComps == 1 || cs.numComps == 3)
|
var numComps = cs.numComps;
|
||||||
|
if (numComps == 1 || numComps == 3)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user