From b36e2a63c2bb633c9092fbde525328b604772fa8 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 8 Apr 2021 22:35:33 +0200 Subject: [PATCH] Update utils.mjs --- source/app/metrics/utils.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index 12870f67..f47e392b 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -18,7 +18,7 @@ import PNG from "png-js" //Exports - export {fs, os, paths, url, util, processes, axios, git, opengraph, rss} + export {fs, os, paths, url, util, processes, axios, git, opengraph, jimp, rss} /**Returns module __dirname */ export function __module(module) { @@ -274,11 +274,11 @@ } /**Create record from puppeteer browser */ - export async function record({page, width, height, frames, scale = 1, quality = 80, x = 0, y = 0, delay = 150}) { + export async function record({page, width, height, frames, scale = 1, quality = 80, x = 0, y = 0, delay = 150, background = yes}) { //Register images frames const images = [] for (let i = 0; i < frames; i++) { - images.push(await page.screenshot({type:"png", clip:{width, height, x, y}})) + images.push(await page.screenshot({type:"png", clip:{width, height, x, y}, omitBackground:background})) await wait(delay/1000) if (i%10 === 0) console.debug(`metrics/record > processed ${i}/${frames} frames`)