]> git.parisson.com Git - pdf.js.git/commitdiff
Fix nits.
authorBrendan Dahl <brendan.dahl@gmail.com>
Mon, 19 Dec 2011 01:29:08 +0000 (17:29 -0800)
committerBrendan Dahl <brendan.dahl@gmail.com>
Mon, 19 Dec 2011 01:29:08 +0000 (17:29 -0800)
src/evaluator.js
src/image.js

index 62682ed3d4654e3d90baa7719cbab6b0b10d0666..cc9f6c07da3dc87241a25c4da910fc13b619a72c 100644 (file)
@@ -221,13 +221,15 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
         fn = 'paintImageXObject';
 
         PDFImage.buildImage(function(imageObj) {
+            var mw = imageObj.maxWidth;
+            var mh = imageObj.maxHeight;
             var imgData = {
-              width: imageObj.maxWidth,
-              height: imageObj.maxHeight,
-              data: new Uint8Array(imageObj.maxWidth * imageObj.maxHeight * 4)
+              width: mw,
+              height: mh,
+              data: new Uint8Array(mw * mh * 4)
             };
             var pixels = imgData.data;
-            imageObj.fillRgbaBuffer(pixels, imageObj.maxWidth, imageObj.maxHeight);
+            imageObj.fillRgbaBuffer(pixels, mw, mh);
             handler.send('obj', [objId, 'Image', imgData]);
           }, handler, xref, resources, image, inline);
       }
index 3cacb791f5cea6c660fc7b990a28a4a1b0d01e90..8762b806f8b2348455f0689ab4eed9cb1a951143 100644 (file)
@@ -154,7 +154,7 @@ var PDFImage = (function PDFImageClosure() {
         oldIndex = ((py * w1) + px);
         if (components === 1) {
           temp[newIndex] = pixels[oldIndex];
-        } else if(components === 3) {
+        } else if (components === 3) {
           newIndex *= 3;
           oldIndex *= 3;
           temp[newIndex] = pixels[oldIndex];
@@ -321,8 +321,8 @@ var PDFImage = (function PDFImageClosure() {
       var comps = this.colorSpace.getRgbBuffer(
         this.getComponents(imgArray), bpc);
       if (originalWidth != width || originalHeight != height)
-        comps = PDFImage.resize(comps, this.bpc, 3, originalWidth, originalHeight,
-                                  width, height);
+        comps = PDFImage.resize(comps, this.bpc, 3, originalWidth,
+                                originalHeight, width, height);
       var compsPos = 0;
       var opacity = this.getOpacity(width, height);
       var opacityPos = 0;