question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracing screenshot size differs

See original GitHub issue

I get issue to compute the speed index using speedline module. The size of the screenshots into the tracing file are not all the same. The strange thing is that the issue occurs around 66% times, running 3 times the same code, the issue occurs twice.

Steps to reproduce

  • Puppeteer version: puppeteer@0.13.0
  • Platform / OS version: Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const speedline = require('speedline');

async function run() {
    const iPhone = devices['iPhone 6'];
    const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
    const filename = 'trace.json';

    const page = await browser.newPage();
    await page.emulate(iPhone);
    try {
        await page.tracing.start({path: filename, screenshots: true});
        await page.goto('https://www.amazon.fr');
        await page.tracing.stop();
        const results = await speedline(filename);
        console.log('Speed Index value:', results.speedIndex);
    } catch (e) {
        console.error(e);
    }
    browser.close();
}

run();

What is the expected result? Image should all be 375x667 according to the DeviceDescriptors.jsfile

{
    'name': 'iPhone 6',
    'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1',
    'viewport': {
      'width': 375,
      'height': 667,
      'deviceScaleFactor': 2,
      'isMobile': true,
      'hasTouch': true,
      'isLandscape': false
    }
  },

What happens instead? The two first pictures size are 376x667, triggering an exception Images have different sizes! into ImageSSIM

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Jan 12, 2018

I can repro this every other time. Seems to be a chromium bug.

1reaction
softwarererocommented, Nov 30, 2017

I ran into the same issue today. This happens also when setting the device or viewport at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tracing screenshot size differs · Issue #1427 - GitHub
I get issue to compute the speed index using speedline module. The size of the screenshots into the tracing file are not all...
Read more >
Screenshots size of file - Microsoft Community
Hi everyone. I have a question regarding the screenshots that I save. I have a lot of screenshots saved. Some of them are...
Read more >
Visual Testing using Screenshot Comparison - Ghost Inspector
The system will track different baselines for each combination of browser, screen size and geolocation. This means that if you run at test...
Read more >
1164757 - Capture full size screenshot is broken - Monorail
Regarding different width of the "headfull" screenshots - it can be due to the different scrollbars' width, or due to different scale factor....
Read more >
App Screenshot Sizes and Guidelines for Huawei AppGallery
Huawei Guidelines clearly state that AppGallery can accept a minimum of 3 different app screenshots for your app. However, pay attention to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found