Skip to content

Commit

Permalink
Merge pull request #5028 from ThatOtherPerson/fix/low-res-images
Browse files Browse the repository at this point in the history
Wait for images to load before screenshotting
  • Loading branch information
m-allanson authored Apr 18, 2018
2 parents 38e5822 + 990b61f commit ccf4203
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/gatsby-transformer-screenshot/lambda/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ exports.run = async (browser, url, width, height) => {

await page.setViewport({ width, height })
await page.goto(url, { waitUntil: [`load`, `networkidle0`] })
// wait for full-size images to fade in
await page.waitFor(1000);

const screenshot = await page.screenshot()
const up = await s3PutObject(key, screenshot)
Expand Down

0 comments on commit ccf4203

Please sign in to comment.