Skip to content

Commit

Permalink
chore: simple message changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 1, 2024
1 parent 03de3ed commit 812394c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/engines/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ class Puppeteer extends engine.Engine {
res.send(data);
} else {
// checks if the format is natively supported by puppeteer
// and if that's not the case re-encoding is needed
// and if that's not the case re-encoding is needed, uses
// PNG format as the base one when doing re-encoding
const reEncode = ["png", "jpeg", "webp"].indexOf(format) === -1;
const type = reEncode ? "png" : format;
const baseFormat = reEncode ? "png" : format;

let data = await page.screenshot({
fullPage: fullPage,
type: type
type: baseFormat
});
if (trim || reEncode) {
const image = await jimp.read(data);
Expand Down

0 comments on commit 812394c

Please sign in to comment.