Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// closed
});
png.on('foo', () => {});
png.pack().adjustGamma();
png.parse('foo').adjustGamma();
png.parse(Buffer.from('foo')).adjustGamma();
png.parse('foo', (error, data) => {
error.stack;
data.adjustGamma();
}).adjustGamma();
PNG.adjustGamma(png);
PNG.bitblt(png, pngs[1]);
PNG.bitblt(png, pngs[1], 1, 1, 1, 1, 1, 1);
composerParams.images.forEach((image, index) => {
PNG.bitblt(
image.imageData, compositeResultImage, 0, 0, image.imageWidth, image.imageHeight,
composerParams.offsetX * index, composerParams.offsetY * index
);
});
// Set filter type to Paeth to avoid expensive auto scanline filter detection
});
png.on('foo', () => {});
png.pack().adjustGamma();
png.parse('foo').adjustGamma();
png.parse(Buffer.from('foo')).adjustGamma();
png.parse('foo', (error, data) => {
error.stack;
data.adjustGamma();
}).adjustGamma();
PNG.adjustGamma(png);
PNG.bitblt(png, pngs[1]);
PNG.bitblt(png, pngs[1], 1, 1, 1, 1, 1, 1);
function createCompareCanvas(width, height, source) {
const canvas = new PNG({
width,
height,
colorType: 6,
bgColor: {
red: 0,
green: 0,
blue: 0,
alpha: 0,
}
});
PNG.bitblt(source, canvas, 0, 0, source.width, source.height, 0, 0);
return canvas;
}
function cropImage (png, areaData) {
let { minX, minY, maxX, maxY } = areaData;
let width = maxX - minX;
let height = maxY - minY;
let cropped = new PNG({ width, height });
PNG.bitblt(png, cropped, minX, minY, width, height, 0, 0);
return cropped;
}
const createImageResizer = (width, height) => (source) => {
const resized = new PNG({ width, height, fill: true });
PNG.bitblt(source, resized, 0, 0, source.width, source.height, 0, 0);
return resized;
};