Limit image size to 1024*1024 for b2g.

This commit is contained in:
Brendan Dahl 2013-07-10 09:52:37 -07:00
parent d71948038f
commit bcc085ec52
5 changed files with 26 additions and 2 deletions

View file

@ -21,6 +21,13 @@
'use strict';
/**
* The maximum allowed image size in total pixels e.g. width * height. Images
* above this value will not be drawn. Use -1 for no limit.
* @var {Number}
*/
PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize;
/**
* This is the main entry point for loading a PDF and interacting with it.
* NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR)
@ -760,7 +767,8 @@ var WorkerTransport = (function WorkerTransportClosure() {
source.chunkedViewerLoading = !!this.pdfDataRangeTransport;
this.messageHandler.send('GetDocRequest', {
source: source,
disableRange: PDFJS.disableRange
disableRange: PDFJS.disableRange,
maxImageSize: PDFJS.maxImageSize
});
},