From 378767c15b5d67ace5664fda01b32ed3c5648a0a Mon Sep 17 00:00:00 2001 From: Clark Sell Date: Wed, 13 Oct 2021 08:20:35 -0500 Subject: [PATCH 1/2] lowering the resolution --- functions/that-api-og-image/src/lib/chromium.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/that-api-og-image/src/lib/chromium.js b/functions/that-api-og-image/src/lib/chromium.js index 4aff073..51b8c94 100644 --- a/functions/that-api-og-image/src/lib/chromium.js +++ b/functions/that-api-og-image/src/lib/chromium.js @@ -20,8 +20,9 @@ export async function createScreenshot(url) { ignoreHTTPSErrors: true, }); + // leaving for future reference - await page.setViewport({ width: 2048, height: 1170, deviceScaleFactor: 2 }); + await page.setViewport({ width: 1200, height: 630 }); const page = await browser.newPage(); - await page.setViewport({ width: 2048, height: 1170, deviceScaleFactor: 2 }); await page.setUserAgent(userAgent); await page.goto(url, { waitUntil: 'networkidle2' }); From 9f5beb7f8ee2b8b7a7703c7690116d5dd99f1982 Mon Sep 17 00:00:00 2001 From: Clark Sell Date: Wed, 13 Oct 2021 08:24:14 -0500 Subject: [PATCH 2/2] fixing object creating --- functions/that-api-og-image/src/lib/chromium.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/that-api-og-image/src/lib/chromium.js b/functions/that-api-og-image/src/lib/chromium.js index 51b8c94..cf90ef7 100644 --- a/functions/that-api-og-image/src/lib/chromium.js +++ b/functions/that-api-og-image/src/lib/chromium.js @@ -20,9 +20,9 @@ export async function createScreenshot(url) { ignoreHTTPSErrors: true, }); + const page = await browser.newPage(); // leaving for future reference - await page.setViewport({ width: 2048, height: 1170, deviceScaleFactor: 2 }); await page.setViewport({ width: 1200, height: 630 }); - const page = await browser.newPage(); await page.setUserAgent(userAgent); await page.goto(url, { waitUntil: 'networkidle2' });