Fill the initial JBIG2 buffer with 0xFF only if defaultPixelValue is set
Per the TypedArray specification, ArrayBuffers are initialized with zeros. http://www.khronos.org/registry/typedarray/specs/latest/#5
This commit is contained in:
parent
7657011985
commit
135660c8ba
@ -994,9 +994,13 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||||||
this.currentPageInfo = info;
|
this.currentPageInfo = info;
|
||||||
var rowSize = (info.width + 7) >> 3;
|
var rowSize = (info.width + 7) >> 3;
|
||||||
var buffer = new Uint8Array(rowSize * info.height);
|
var buffer = new Uint8Array(rowSize * info.height);
|
||||||
var fill = info.defaultPixelValue ? 0xFF : 0;
|
// The contents of ArrayBuffers are initialized to 0.
|
||||||
for (var i = 0, ii = buffer.length; i < ii; i++)
|
// Fill the buffer with 0xFF only if info.defaultPixelValue is set
|
||||||
buffer[i] = fill;
|
if (info.defaultPixelValue) {
|
||||||
|
for (var i = 0, ii = buffer.length; i < ii; i++) {
|
||||||
|
buffer[i] = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
},
|
},
|
||||||
drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) {
|
drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user