Browse Source

Add strict equalities in src/core/colorspace.js

Jonas Jenwald 11 years ago
parent
commit
0012b8803c
  1. 12
      src/core/colorspace.js

12
src/core/colorspace.js

@ -84,7 +84,7 @@ var ColorSpace = (function ColorSpaceClosure() {
var count = originalWidth * originalHeight; var count = originalWidth * originalHeight;
var rgbBuf = null; var rgbBuf = null;
var numComponentColors = 1 << bpc; var numComponentColors = 1 << bpc;
var needsResizing = originalHeight != height || originalWidth != width; var needsResizing = originalHeight !== height || originalWidth !== width;
var i, ii; var i, ii;
if (this.isPassthrough(bpc)) { if (this.isPassthrough(bpc)) {
@ -277,11 +277,11 @@ var ColorSpace = (function ColorSpaceClosure() {
var stream = xref.fetchIfRef(cs[1]); var stream = xref.fetchIfRef(cs[1]);
var dict = stream.dict; var dict = stream.dict;
numComps = dict.get('N'); numComps = dict.get('N');
if (numComps == 1) { if (numComps === 1) {
return 'DeviceGrayCS'; return 'DeviceGrayCS';
} else if (numComps == 3) { } else if (numComps === 3) {
return 'DeviceRgbCS'; return 'DeviceRgbCS';
} else if (numComps == 4) { } else if (numComps === 4) {
return 'DeviceCmykCS'; return 'DeviceCmykCS';
} }
break; break;
@ -342,7 +342,7 @@ var ColorSpace = (function ColorSpaceClosure() {
return true; return true;
} }
for (var i = 0, ii = decode.length; i < ii; i += 2) { for (var i = 0, ii = decode.length; i < ii; i += 2) {
if (decode[i] !== 0 || decode[i + 1] != 1) { if (decode[i] !== 0 || decode[i + 1] !== 1) {
return false; return false;
} }
} }
@ -607,7 +607,7 @@ var DeviceRgbCS = (function DeviceRgbCSClosure() {
return (inputLength * (3 + alpha01) / 3) | 0; return (inputLength * (3 + alpha01) / 3) | 0;
}, },
isPassthrough: function DeviceRgbCS_isPassthrough(bits) { isPassthrough: function DeviceRgbCS_isPassthrough(bits) {
return bits == 8; return bits === 8;
}, },
fillRgb: ColorSpace.prototype.fillRgb, fillRgb: ColorSpace.prototype.fillRgb,
isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) {

Loading…
Cancel
Save