Skip to content

Commit

Permalink
Merge f8e562c into 5e35525
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 25, 2019
2 parents 5e35525 + f8e562c commit 95440f1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/screenshot/src/index.js
Expand Up @@ -39,18 +39,16 @@ module.exports = gotoOpts => {

if (!overlay) return screenshot

const { browser: browserTheme, background } = overlay

const { browser: browserSkin, background } = overlay
let image = await sharp(await getBackground(background))
let inputs = [{ input: screenshot }]

if (browserTheme) {
const input = browserOverlay[browserTheme]
if (browserSkin) {
const input = browserOverlay[browserSkin]
if (input) inputs = [{ input }].concat(inputs)
}

image = await image.composite(inputs)
const buffer = await image.toBuffer()
return buffer
return opts.path ? image.toFile(opts.path) : image.toBuffer()
}
}

0 comments on commit 95440f1

Please sign in to comment.