|
@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
|
}
|
|
}
|
|
|
|
|
|
-PDFJS.version = '1.0.913';
|
|
|
|
-PDFJS.build = '419ba54';
|
|
|
|
|
|
+PDFJS.version = '1.0.915';
|
|
|
|
+PDFJS.build = '8bfc4b8';
|
|
|
|
|
|
(function pdfjsWrapper() {
|
|
(function pdfjsWrapper() {
|
|
// Use strict in our context only - users might not want it
|
|
// Use strict in our context only - users might not want it
|
|
@@ -41282,18 +41282,52 @@ var JpxImage = (function JpxImageClosure() {
|
|
var dataLength = lbox - headerSize;
|
|
var dataLength = lbox - headerSize;
|
|
var jumpDataLength = true;
|
|
var jumpDataLength = true;
|
|
switch (tbox) {
|
|
switch (tbox) {
|
|
- case 0x6A501A1A: // 'jP\032\032'
|
|
|
|
- // TODO
|
|
|
|
- break;
|
|
|
|
case 0x6A703268: // 'jp2h'
|
|
case 0x6A703268: // 'jp2h'
|
|
jumpDataLength = false; // parsing child boxes
|
|
jumpDataLength = false; // parsing child boxes
|
|
break;
|
|
break;
|
|
case 0x636F6C72: // 'colr'
|
|
case 0x636F6C72: // 'colr'
|
|
- // TODO
|
|
|
|
|
|
+ // Colorspaces are not used, the CS from the PDF is used.
|
|
|
|
+ var method = data[position];
|
|
|
|
+ var precedence = data[position + 1];
|
|
|
|
+ var approximation = data[position + 2];
|
|
|
|
+ if (method === 1) {
|
|
|
|
+ // enumerated colorspace
|
|
|
|
+ var colorspace = readUint32(data, position + 3);
|
|
|
|
+ switch (colorspace) {
|
|
|
|
+ case 16: // this indicates a sRGB colorspace
|
|
|
|
+ case 17: // this indicates a grayscale colorspace
|
|
|
|
+ case 18: // this indicates a YUV colorspace
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ warn('Unknown colorspace ' + colorspace);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ } else if (method === 2) {
|
|
|
|
+ info('ICC profile not supported');
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case 0x6A703263: // 'jp2c'
|
|
case 0x6A703263: // 'jp2c'
|
|
this.parseCodestream(data, position, position + dataLength);
|
|
this.parseCodestream(data, position, position + dataLength);
|
|
break;
|
|
break;
|
|
|
|
+ case 0x6A502020: // 'jP\024\024'
|
|
|
|
+ if (0x0d0a870a !== readUint32(data, position)) {
|
|
|
|
+ warn('Invalid JP2 signature');
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ // The following header types are valid but currently not used:
|
|
|
|
+ case 0x6A501A1A: // 'jP\032\032'
|
|
|
|
+ case 0x66747970: // 'ftyp'
|
|
|
|
+ case 0x72726571: // 'rreq'
|
|
|
|
+ case 0x72657320: // 'res '
|
|
|
|
+ case 0x69686472: // 'ihdr'
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ var headerType = String.fromCharCode((tbox >> 24) & 0xFF,
|
|
|
|
+ (tbox >> 16) & 0xFF,
|
|
|
|
+ (tbox >> 8) & 0xFF,
|
|
|
|
+ tbox & 0xFF);
|
|
|
|
+ warn('Unsupported header type ' + tbox + ' (' + headerType + ')');
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
if (jumpDataLength) {
|
|
if (jumpDataLength) {
|
|
position += dataLength;
|
|
position += dataLength;
|
|
@@ -42007,11 +42041,11 @@ var JpxImage = (function JpxImageClosure() {
|
|
var tile = context.tiles[tileIndex];
|
|
var tile = context.tiles[tileIndex];
|
|
var packetsIterator = tile.packetsIterator;
|
|
var packetsIterator = tile.packetsIterator;
|
|
while (position < dataLength) {
|
|
while (position < dataLength) {
|
|
- var packet = packetsIterator.nextPacket();
|
|
|
|
|
|
+ alignToByte();
|
|
if (!readBits(1)) {
|
|
if (!readBits(1)) {
|
|
- alignToByte();
|
|
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ var packet = packetsIterator.nextPacket();
|
|
var layerNumber = packet.layerNumber;
|
|
var layerNumber = packet.layerNumber;
|
|
var queue = [], codeblock;
|
|
var queue = [], codeblock;
|
|
for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) {
|
|
for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) {
|
|
@@ -42022,13 +42056,13 @@ var JpxImage = (function JpxImageClosure() {
|
|
var codeblockIncluded = false;
|
|
var codeblockIncluded = false;
|
|
var firstTimeInclusion = false;
|
|
var firstTimeInclusion = false;
|
|
var valueReady;
|
|
var valueReady;
|
|
- if ('included' in codeblock) {
|
|
|
|
|
|
+ if (codeblock['included'] !== undefined) {
|
|
codeblockIncluded = !!readBits(1);
|
|
codeblockIncluded = !!readBits(1);
|
|
} else {
|
|
} else {
|
|
// reading inclusion tree
|
|
// reading inclusion tree
|
|
precinct = codeblock.precinct;
|
|
precinct = codeblock.precinct;
|
|
var inclusionTree, zeroBitPlanesTree;
|
|
var inclusionTree, zeroBitPlanesTree;
|
|
- if ('inclusionTree' in precinct) {
|
|
|
|
|
|
+ if (precinct['inclusionTree'] !== undefined) {
|
|
inclusionTree = precinct.inclusionTree;
|
|
inclusionTree = precinct.inclusionTree;
|
|
} else {
|
|
} else {
|
|
// building inclusion and zero bit-planes trees
|
|
// building inclusion and zero bit-planes trees
|
|
@@ -42093,7 +42127,7 @@ var JpxImage = (function JpxImageClosure() {
|
|
while (queue.length > 0) {
|
|
while (queue.length > 0) {
|
|
var packetItem = queue.shift();
|
|
var packetItem = queue.shift();
|
|
codeblock = packetItem.codeblock;
|
|
codeblock = packetItem.codeblock;
|
|
- if (!('data' in codeblock)) {
|
|
|
|
|
|
+ if (codeblock['data'] === undefined) {
|
|
codeblock.data = [];
|
|
codeblock.data = [];
|
|
}
|
|
}
|
|
codeblock.data.push({
|
|
codeblock.data.push({
|
|
@@ -42123,7 +42157,7 @@ var JpxImage = (function JpxImageClosure() {
|
|
if (blockWidth === 0 || blockHeight === 0) {
|
|
if (blockWidth === 0 || blockHeight === 0) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- if (!('data' in codeblock)) {
|
|
|
|
|
|
+ if (codeblock['data'] === undefined) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -42378,10 +42412,10 @@ var JpxImage = (function JpxImageClosure() {
|
|
var tile = context.tiles[tileIndex];
|
|
var tile = context.tiles[tileIndex];
|
|
for (var c = 0; c < componentsCount; c++) {
|
|
for (var c = 0; c < componentsCount; c++) {
|
|
var component = tile.components[c];
|
|
var component = tile.components[c];
|
|
- var qcdOrQcc = (c in context.currentTile.QCC ?
|
|
|
|
|
|
+ var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ?
|
|
context.currentTile.QCC[c] : context.currentTile.QCD);
|
|
context.currentTile.QCC[c] : context.currentTile.QCD);
|
|
component.quantizationParameters = qcdOrQcc;
|
|
component.quantizationParameters = qcdOrQcc;
|
|
- var codOrCoc = (c in context.currentTile.COC ?
|
|
|
|
|
|
+ var codOrCoc = (context.currentTile.COC[c] !== undefined ?
|
|
context.currentTile.COC[c] : context.currentTile.COD);
|
|
context.currentTile.COC[c] : context.currentTile.COD);
|
|
component.codingStyleParameters = codOrCoc;
|
|
component.codingStyleParameters = codOrCoc;
|
|
}
|
|
}
|
|
@@ -42410,7 +42444,7 @@ var JpxImage = (function JpxImageClosure() {
|
|
while (currentLevel < this.levels.length) {
|
|
while (currentLevel < this.levels.length) {
|
|
level = this.levels[currentLevel];
|
|
level = this.levels[currentLevel];
|
|
var index = i + j * level.width;
|
|
var index = i + j * level.width;
|
|
- if (index in level.items) {
|
|
|
|
|
|
+ if (level.items[index] !== undefined) {
|
|
value = level.items[index];
|
|
value = level.items[index];
|
|
break;
|
|
break;
|
|
}
|
|
}
|