From d59fb5a02bc2373eb6a562ed2281449b5e9f6d05 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Thu, 18 Feb 2016 11:11:48 +0000 Subject: [PATCH] PDF.js version 1.4.81 - See mozilla/pdf.js@8cdb69634f6149f400541794b69e6fc85c433420 --- bower.json | 2 +- build/pdf.combined.js | 17 ++++++++++++++--- build/pdf.js | 4 ++-- build/pdf.worker.js | 17 ++++++++++++++--- package.json | 2 +- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index f003c7b69..6876c04b1 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.79", + "version": "1.4.81", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index b040b741b..870f94415 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.79'; -var pdfjsBuild = '9eedfc1'; +var pdfjsVersion = '1.4.81'; +var pdfjsBuild = '8cdb696'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -1615,7 +1615,18 @@ var JpegImage = (function jpegImage() { // type of data: Uint8Array(width * height * numComponents) var data = this._getLinearizedBlockData(width, height); - if (this.numComponents === 3) { + if (this.numComponents === 1 && forceRGBoutput) { + var dataLength = data.length; + var rgbData = new Uint8Array(dataLength * 3); + var offset = 0; + for (var i = 0; i < dataLength; i++) { + var grayColor = data[i]; + rgbData[offset++] = grayColor; + rgbData[offset++] = grayColor; + rgbData[offset++] = grayColor; + } + return rgbData; + } else if (this.numComponents === 3) { return this._convertYccToRgb(data); } else if (this.numComponents === 4) { if (this._isColorConversionNeeded()) { diff --git a/build/pdf.js b/build/pdf.js index 39a6a1421..9eed7094b 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.79'; -var pdfjsBuild = '9eedfc1'; +var pdfjsVersion = '1.4.81'; +var pdfjsBuild = '8cdb696'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 256ffe8b5..c554c0c30 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.79'; -var pdfjsBuild = '9eedfc1'; +var pdfjsVersion = '1.4.81'; +var pdfjsBuild = '8cdb696'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -1615,7 +1615,18 @@ var JpegImage = (function jpegImage() { // type of data: Uint8Array(width * height * numComponents) var data = this._getLinearizedBlockData(width, height); - if (this.numComponents === 3) { + if (this.numComponents === 1 && forceRGBoutput) { + var dataLength = data.length; + var rgbData = new Uint8Array(dataLength * 3); + var offset = 0; + for (var i = 0; i < dataLength; i++) { + var grayColor = data[i]; + rgbData[offset++] = grayColor; + rgbData[offset++] = grayColor; + rgbData[offset++] = grayColor; + } + return rgbData; + } else if (this.numComponents === 3) { return this._convertYccToRgb(data); } else if (this.numComponents === 4) { if (this._isColorConversionNeeded()) { diff --git a/package.json b/package.json index 69e1bb319..83fc19cc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.79", + "version": "1.4.81", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [