Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!await Capturer._isScreenshotCaptured(screenshotPath))
return;
const image = await readPngFile(screenshotPath);
const croppedImage = await cropScreenshot(image, {
markSeed,
clientAreaDimensions,
path: screenshotPath,
cropDimensions: Capturer._getCropDimensions(cropDimensions, pageDimensions)
});
if (croppedImage)
await writePng(screenshotPath, croppedImage);
await generateThumbnail(screenshotPath, thumbnailPath);
});