diff --git a/bower.json b/bower.json index 588a576c0..e018ddbe9 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.710", + "version": "1.0.712", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 8cb72e818..a90842bb6 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.710'; -PDFJS.build = '0dbac15'; +PDFJS.version = '1.0.712'; +PDFJS.build = '6969ed4'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -32457,10 +32457,11 @@ var PDFImage = (function PDFImageClosure() { var kind; if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8) { + } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && + !this.needsDecode) { kind = ImageKind.RGB_24BPP; } - if (kind && !this.smask && !this.mask && !this.needsDecode && + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { imgData.kind = kind; @@ -32477,6 +32478,14 @@ var PDFImage = (function PDFImageClosure() { newArray.set(imgArray); imgData.data = newArray; } + if (this.needsDecode) { + // Invert the buffer (which must be grayscale if we reached here). + assert(kind === ImageKind.GRAYSCALE_1BPP); + var buffer = imgData.data; + for (var i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; + } + } return imgData; } if (this.image instanceof JpegStream && !this.smask && !this.mask) { diff --git a/build/pdf.js b/build/pdf.js index 54d119d1d..cb69b433b 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.710'; -PDFJS.build = '0dbac15'; +PDFJS.version = '1.0.712'; +PDFJS.build = '6969ed4'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 67110c19b..ced93e87e 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.710'; -PDFJS.build = '0dbac15'; +PDFJS.version = '1.0.712'; +PDFJS.build = '6969ed4'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -26427,10 +26427,11 @@ var PDFImage = (function PDFImageClosure() { var kind; if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8) { + } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && + !this.needsDecode) { kind = ImageKind.RGB_24BPP; } - if (kind && !this.smask && !this.mask && !this.needsDecode && + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { imgData.kind = kind; @@ -26447,6 +26448,14 @@ var PDFImage = (function PDFImageClosure() { newArray.set(imgArray); imgData.data = newArray; } + if (this.needsDecode) { + // Invert the buffer (which must be grayscale if we reached here). + assert(kind === ImageKind.GRAYSCALE_1BPP); + var buffer = imgData.data; + for (var i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; + } + } return imgData; } if (this.image instanceof JpegStream && !this.smask && !this.mask) { diff --git a/package.json b/package.json index 733443ee1..bcfd6af54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.710", + "version": "1.0.712", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",