Use JPX and JPEG in error messages.

Also throw in workerConsole.
This commit is contained in:
Kalervo Kujala 2012-01-29 22:25:06 +02:00
parent f6cb7b2a24
commit e3a3ec6f2e
3 changed files with 10 additions and 9 deletions

View File

@ -1052,7 +1052,7 @@ var JpxImage = (function JpxImageClosure() {
} }
r = 0; r = 0;
} }
error('Out of packets'); error('JPX error: Out of packets');
}; };
} }
function ResolutionLayerComponentPositionIterator(context) { function ResolutionLayerComponentPositionIterator(context) {
@ -1091,7 +1091,7 @@ var JpxImage = (function JpxImageClosure() {
} }
l = 0; l = 0;
} }
error('Out of packets'); error('JPX error: Out of packets');
}; };
} }
function buildPackets(context) { function buildPackets(context) {
@ -1187,7 +1187,7 @@ var JpxImage = (function JpxImageClosure() {
new ResolutionLayerComponentPositionIterator(context); new ResolutionLayerComponentPositionIterator(context);
break; break;
default: default:
error('Unsupported progression order ' + progressionOrder); error('JPX error: Unsupported progression order ' + progressionOrder);
} }
} }
function parseTilePackets(context, data, offset, dataLength) { function parseTilePackets(context, data, offset, dataLength) {
@ -1589,7 +1589,7 @@ var JpxImage = (function JpxImageClosure() {
if (lbox == 0) if (lbox == 0)
lbox = length - position + headerSize; lbox = length - position + headerSize;
if (lbox < headerSize) if (lbox < headerSize)
error('Invalid box field size'); error('JPX error: Invalid box field size');
var dataLength = lbox - headerSize; var dataLength = lbox - headerSize;
var jumpDataLength = true; var jumpDataLength = true;
switch (tbox) { switch (tbox) {
@ -1675,7 +1675,7 @@ var JpxImage = (function JpxImageClosure() {
scalarExpounded = true; scalarExpounded = true;
break; break;
default: default:
error('Invalid SQcd value ' + sqcd); error('JPX error: Invalid SQcd value ' + sqcd);
} }
qcd.noQuantization = spqcdSize == 8; qcd.noQuantization = spqcdSize == 8;
qcd.scalarExpounded = scalarExpounded; qcd.scalarExpounded = scalarExpounded;
@ -1728,7 +1728,7 @@ var JpxImage = (function JpxImageClosure() {
scalarExpounded = true; scalarExpounded = true;
break; break;
default: default:
error('Invalid SQcd value ' + sqcd); error('JPX error: Invalid SQcd value ' + sqcd);
} }
qcc.noQuantization = spqcdSize == 8; qcc.noQuantization = spqcdSize == 8;
qcc.scalarExpounded = scalarExpounded; qcc.scalarExpounded = scalarExpounded;
@ -1795,7 +1795,7 @@ var JpxImage = (function JpxImageClosure() {
cod.terminationOnEachCodingPass || cod.terminationOnEachCodingPass ||
cod.verticalyStripe || cod.predictableTermination || cod.verticalyStripe || cod.predictableTermination ||
cod.segmentationSymbolUsed) cod.segmentationSymbolUsed)
error('Unsupported COD options: ' + uneval(cod)); error('JPX error: Unsupported COD options: ' + uneval(cod));
if (context.mainHeader) if (context.mainHeader)
context.COD = cod; context.COD = cod;
@ -1840,7 +1840,7 @@ var JpxImage = (function JpxImageClosure() {
// skipping content // skipping content
break; break;
default: default:
error('Unknown codestream code: ' + code.toString(16)); error('JPX error: Unknown codestream code: ' + code.toString(16));
} }
position += length; position += length;
} }

View File

@ -832,7 +832,7 @@ var JpegStream = (function JpegStreamClosure() {
this.buffer = data; this.buffer = data;
this.bufferLength = data.length; this.bufferLength = data.length;
} catch (e) { } catch (e) {
error(e); error('JPEG error: ' + e);
} }
}; };
JpegStream.prototype.getIR = function jpegStreamGetIR() { JpegStream.prototype.getIR = function jpegStreamGetIR() {

View File

@ -208,6 +208,7 @@ var workerConsole = {
action: 'console_error', action: 'console_error',
data: args data: args
}); });
throw 'pdf.js execution error';
}, },
time: function time(name) { time: function time(name) {