From 95a1f9a47b7e8f7fbf9f8704493d65b3e80fe198 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 22 Sep 2014 16:23:54 -0500 Subject: [PATCH] PDF.js version 1.0.219 --- bower.json | 2 +- build/pdf.combined.js | 93 +++++++++++++------------------------------ build/pdf.js | 4 +- build/pdf.worker.js | 93 +++++++++++++------------------------------ package.json | 2 +- 5 files changed, 60 insertions(+), 134 deletions(-) diff --git a/bower.json b/bower.json index 88a915f60..8a40bc600 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.217", + "version": "1.0.219", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 0cdedeb8d..35da9ebb6 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.217'; -PDFJS.build = '37a6aac'; +PDFJS.version = '1.0.219'; +PDFJS.build = 'c0419d7'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -45500,7 +45500,7 @@ var Jbig2Image = (function Jbig2ImageClosure() { if (id in this) { return this[id]; } - return (this[id] = new Int8Array(1<<16)); + return (this[id] = new Int8Array(1 << 16)); } }; @@ -45525,69 +45525,32 @@ var Jbig2Image = (function Jbig2ImageClosure() { // A.2 Procedure for decoding values function decodeInteger(contextCache, procedure, decoder) { var contexts = contextCache.getContexts(procedure); - var prev = 1; - var state = 1, v = 0, s; - var toRead = 32, offset = 4436; // defaults for state 7 - while (state) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - switch (state) { - case 1: - s = !!bit; - break; - case 2: - if (bit) { - break; - } - state = 7; - toRead = 2; - offset = 0; - break; - case 3: - if (bit) { - break; - } - state = 7; - toRead = 4; - offset = 4; - break; - case 4: - if (bit) { - break; - } - state = 7; - toRead = 6; - offset = 20; - break; - case 5: - if (bit) { - break; - } - state = 7; - toRead = 8; - offset = 84; - break; - case 6: - if (bit) { - break; - } - state = 7; - toRead = 12; - offset = 340; - break; - default: - v = ((v << 1) | bit) >>> 0; - if (--toRead === 0) { - state = 0; - } - continue; - } - state++; - } - v += offset; - return (!s ? v : (v > 0 ? -v : null)); + + function readBits(length) { + var v = 0; + for (var i = 0; i < length; i++) { + var bit = decoder.readBit(contexts, prev); + prev = (prev < 256 ? (prev << 1) | bit : + (((prev << 1) | bit) & 511) | 256); + v = (v << 1) | bit; + } + return v >>> 0; + } + + var sign = readBits(1); + var value = readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(32) + 4436) : + readBits(12) + 340) : + readBits(8) + 84) : + readBits(6) + 20) : + readBits(4) + 4) : + readBits(2); + return (sign === 0 ? value : (value > 0 ? -value : null)); } // A.3 The IAID decoding procedure diff --git a/build/pdf.js b/build/pdf.js index e64ae5371..bb5412217 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.217'; -PDFJS.build = '37a6aac'; +PDFJS.version = '1.0.219'; +PDFJS.build = 'c0419d7'; (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 848407008..b54695c09 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.217'; -PDFJS.build = '37a6aac'; +PDFJS.version = '1.0.219'; +PDFJS.build = 'c0419d7'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -40907,7 +40907,7 @@ var Jbig2Image = (function Jbig2ImageClosure() { if (id in this) { return this[id]; } - return (this[id] = new Int8Array(1<<16)); + return (this[id] = new Int8Array(1 << 16)); } }; @@ -40932,69 +40932,32 @@ var Jbig2Image = (function Jbig2ImageClosure() { // A.2 Procedure for decoding values function decodeInteger(contextCache, procedure, decoder) { var contexts = contextCache.getContexts(procedure); - var prev = 1; - var state = 1, v = 0, s; - var toRead = 32, offset = 4436; // defaults for state 7 - while (state) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - switch (state) { - case 1: - s = !!bit; - break; - case 2: - if (bit) { - break; - } - state = 7; - toRead = 2; - offset = 0; - break; - case 3: - if (bit) { - break; - } - state = 7; - toRead = 4; - offset = 4; - break; - case 4: - if (bit) { - break; - } - state = 7; - toRead = 6; - offset = 20; - break; - case 5: - if (bit) { - break; - } - state = 7; - toRead = 8; - offset = 84; - break; - case 6: - if (bit) { - break; - } - state = 7; - toRead = 12; - offset = 340; - break; - default: - v = ((v << 1) | bit) >>> 0; - if (--toRead === 0) { - state = 0; - } - continue; - } - state++; - } - v += offset; - return (!s ? v : (v > 0 ? -v : null)); + + function readBits(length) { + var v = 0; + for (var i = 0; i < length; i++) { + var bit = decoder.readBit(contexts, prev); + prev = (prev < 256 ? (prev << 1) | bit : + (((prev << 1) | bit) & 511) | 256); + v = (v << 1) | bit; + } + return v >>> 0; + } + + var sign = readBits(1); + var value = readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(1) ? + (readBits(32) + 4436) : + readBits(12) + 340) : + readBits(8) + 84) : + readBits(6) + 20) : + readBits(4) + 4) : + readBits(2); + return (sign === 0 ? value : (value > 0 ? -value : null)); } // A.3 The IAID decoding procedure diff --git a/package.json b/package.json index 283b1d329..832172a93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.217", + "version": "1.0.219", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",