Bug 1072164 - Fixes pdf.js for CMYK jpegs. r=bdahl, a=lmandel
authorYury Delendik <ydelendik@mozilla.com>
Thu, 23 Oct 2014 09:13:03 -0500
changeset 225803 d1de09f2d1b0
parent 225802 d080a93fd9e1
child 225804 78b9d7be1770
push id4022
push userryanvm@gmail.com
push date2014-10-24 13:16 +0000
treeherdermozilla-beta@78b9d7be1770 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl, lmandel
bugs1072164
milestone34.0
Bug 1072164 - Fixes pdf.js for CMYK jpegs. r=bdahl, a=lmandel
browser/extensions/pdfjs/content/build/pdf.worker.js
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -30900,17 +30900,17 @@ var JpegStream = (function JpegStreamClo
   JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) {
     if (this.bufferLength) {
       return;
     }
     try {
       var jpegImage = new JpegImage();
 
       // checking if values needs to be transformed before conversion
-      if (this.dict && isArray(this.dict.get('Decode'))) {
+      if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) {
         var decodeArr = this.dict.get('Decode');
         var bitsPerComponent = this.dict.get('BitsPerComponent') || 8;
         var decodeArrLength = decodeArr.length;
         var transform = new Int32Array(decodeArrLength);
         var transformNeeded = false;
         var maxValue = (1 << bitsPerComponent) - 1;
         for (var i = 0; i < decodeArrLength; i += 2) {
           transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0;