fn = 'paintImageXObject';
PDFImage.buildImage(function(imageObj) {
+ var mw = imageObj.maxWidth;
+ var mh = imageObj.maxHeight;
var imgData = {
- width: imageObj.maxWidth,
- height: imageObj.maxHeight,
- data: new Uint8Array(imageObj.maxWidth * imageObj.maxHeight * 4)
+ width: mw,
+ height: mh,
+ data: new Uint8Array(mw * mh * 4)
};
var pixels = imgData.data;
- imageObj.fillRgbaBuffer(pixels, imageObj.maxWidth, imageObj.maxHeight);
+ imageObj.fillRgbaBuffer(pixels, mw, mh);
handler.send('obj', [objId, 'Image', imgData]);
}, handler, xref, resources, image, inline);
}
oldIndex = ((py * w1) + px);
if (components === 1) {
temp[newIndex] = pixels[oldIndex];
- } else if(components === 3) {
+ } else if (components === 3) {
newIndex *= 3;
oldIndex *= 3;
temp[newIndex] = pixels[oldIndex];
var comps = this.colorSpace.getRgbBuffer(
this.getComponents(imgArray), bpc);
if (originalWidth != width || originalHeight != height)
- comps = PDFImage.resize(comps, this.bpc, 3, originalWidth, originalHeight,
- width, height);
+ comps = PDFImage.resize(comps, this.bpc, 3, originalWidth,
+ originalHeight, width, height);
var compsPos = 0;
var opacity = this.getOpacity(width, height);
var opacityPos = 0;