Use strict equalities in src/core/image.js
This commit is contained in:
		
							parent
							
								
									00eea3ddb9
								
							
						
					
					
						commit
						160c7cab33
					
				@ -258,7 +258,7 @@ var PDFImage = (function PDFImageClosure() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    var computedLength = ((width + 7) >> 3) * height;
 | 
					    var computedLength = ((width + 7) >> 3) * height;
 | 
				
			||||||
    var actualLength = imgArray.byteLength;
 | 
					    var actualLength = imgArray.byteLength;
 | 
				
			||||||
    var haveFullData = computedLength == actualLength;
 | 
					    var haveFullData = computedLength === actualLength;
 | 
				
			||||||
    var data, i;
 | 
					    var data, i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) {
 | 
					    if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) {
 | 
				
			||||||
@ -416,7 +416,7 @@ var PDFImage = (function PDFImageClosure() {
 | 
				
			|||||||
        sh = smask.height;
 | 
					        sh = smask.height;
 | 
				
			||||||
        alphaBuf = new Uint8Array(sw * sh);
 | 
					        alphaBuf = new Uint8Array(sw * sh);
 | 
				
			||||||
        smask.fillGrayBuffer(alphaBuf);
 | 
					        smask.fillGrayBuffer(alphaBuf);
 | 
				
			||||||
        if (sw != width || sh != height) {
 | 
					        if (sw !== width || sh !== height) {
 | 
				
			||||||
          alphaBuf = PDFImage.resize(alphaBuf, smask.bpc, 1, sw, sh, width,
 | 
					          alphaBuf = PDFImage.resize(alphaBuf, smask.bpc, 1, sw, sh, width,
 | 
				
			||||||
                                     height);
 | 
					                                     height);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -433,7 +433,7 @@ var PDFImage = (function PDFImageClosure() {
 | 
				
			|||||||
            alphaBuf[i] = 255 - alphaBuf[i];
 | 
					            alphaBuf[i] = 255 - alphaBuf[i];
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if (sw != width || sh != height) {
 | 
					          if (sw !== width || sh !== height) {
 | 
				
			||||||
            alphaBuf = PDFImage.resize(alphaBuf, mask.bpc, 1, sw, sh, width,
 | 
					            alphaBuf = PDFImage.resize(alphaBuf, mask.bpc, 1, sw, sh, width,
 | 
				
			||||||
                                       height);
 | 
					                                       height);
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
@ -602,7 +602,7 @@ var PDFImage = (function PDFImageClosure() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) {
 | 
					    fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) {
 | 
				
			||||||
      var numComps = this.numComps;
 | 
					      var numComps = this.numComps;
 | 
				
			||||||
      if (numComps != 1) {
 | 
					      if (numComps !== 1) {
 | 
				
			||||||
        error('Reading gray scale from a color image: ' + numComps);
 | 
					        error('Reading gray scale from a color image: ' + numComps);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user