mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Reduce memory consumption of simple black and white images.
This commit is contained in:
parent
0049407762
commit
a966909754
3 changed files with 110 additions and 53 deletions
|
@ -165,7 +165,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
(w + h) < SMALL_IMAGE_DIMENSIONS) {
|
||||
var imageObj = new PDFImage(this.xref, resources, image,
|
||||
inline, null, null);
|
||||
var imgData = imageObj.getImageData();
|
||||
var imgData = imageObj.createImageData();
|
||||
operatorList.addOp(OPS.paintInlineImageXObject, [imgData]);
|
||||
return;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
|
||||
|
||||
PDFImage.buildImage(function(imageObj) {
|
||||
var imgData = imageObj.getImageData();
|
||||
var imgData = imageObj.createImageData();
|
||||
self.handler.send('obj', [objId, self.pageIndex, 'Image', imgData],
|
||||
null, [imgData.data.buffer]);
|
||||
}, self.handler, self.xref, resources, image, inline);
|
||||
|
@ -1296,7 +1296,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
// replacing queue items
|
||||
squash(fnArray, j, count * 4, OPS.paintInlineImageXObjectGroup);
|
||||
argsArray.splice(j, count * 4,
|
||||
[{width: imgWidth, height: imgHeight, data: imgData}, map]);
|
||||
[{width: imgWidth, height: imgHeight, kind: 'rgba_32bpp',
|
||||
data: imgData}, map]);
|
||||
i = j;
|
||||
ii = argsArray.length;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue