Skip to content

Commit ccf4203

Browse files
authored
Merge pull request #5028 from ThatOtherPerson/fix/low-res-images
Wait for images to load before screenshotting
2 parents 38e5822 + 990b61f commit ccf4203

File tree

1 file changed

+2
-0
lines changed
  • packages/gatsby-transformer-screenshot/lambda

1 file changed

+2
-0
lines changed

packages/gatsby-transformer-screenshot/lambda/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ exports.run = async (browser, url, width, height) => {
8585

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

8991
const screenshot = await page.screenshot()
9092
const up = await s3PutObject(key, screenshot)

0 commit comments

Comments
 (0)