autowebcompat icon indicating copy to clipboard operation
autowebcompat copied to clipboard

Make the screenshots in the different browsers equal in size

Open marco-c opened this issue 7 years ago • 8 comments

Right now, Chrome is showing a scrollbar that we should get rid of, as it is simply adding noise. Once we remove the scrollbar, the screenshots are probably not the same size in Firefox and Chrome, so we should adjust it to be the same.

marco-c avatar Jan 31 '18 12:01 marco-c

9465_chrome 9465_firefox

I found scrollbars earlier in data.zip but not when i am downloading images while now, 1st image is by chrome and the 2nd one is with firefox. whether this issue is already resolved?

marxmit7 avatar Feb 08 '18 12:02 marxmit7

@amit2rockon I am pretty sure many of the settings of browsers are system dependent. For me images are not coming same in size.

sagarvijaygupta avatar Feb 08 '18 14:02 sagarvijaygupta

I was checking out the dataset, 10030_0_chrome 10030_0_firefox

Since the content is same irrespective if scrollbar is visible or not, we could simply scale the larger image to the size of smaller one, once we removed the scroll bar. But seeing these images, the firefox has complete page while chrome has only first screen with scroll bar. So should we need to crop the firefox images as well depending upon the chrome's view ?

poush avatar Feb 17 '18 19:02 poush

Since the content is same irrespective if scrollbar is visible or not, we could simply scale the larger image to the size of smaller one, once we removed the scroll bar.

Instead of scaling, it would be more precise if we could get the same screenshot sizes directly. If we can't do that, I guess scaling would be an acceptable fallback solution.

But seeing these images, the firefox has complete page while chrome has only first screen with scroll bar. So should we need to crop the firefox images as well depending upon the chrome's view ?

This happens sometimes, but I think it's a problem of the screenshotting. We simply need to crop the image to the usual size in those cases.

marco-c avatar Feb 18 '18 19:02 marco-c

Some solutions to remove the scrollbars at the source are described here: https://stackoverflow.com/questions/9449562/how-to-remove-scrollbar-in-chromedriver-how-to-change-http-agent. I think the --hide-scrollbars one doesn't work anymore, as the flag has been removed. The second solution might work, but I wonder if it could cause other issues.

Another possible solution is to use mobile emulation for Chromium: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation.

The last possible solution I see is to cut the scrollbar from the screenshots.

marco-c avatar Apr 11 '18 08:04 marco-c

It looks like --hide-scrollbars was added back (only when in headless mode): https://github.com/chromium/chromium/commit/d71fc504213b7d60f98d8b1db9abb6bda280a042.

marco-c avatar Apr 11 '18 09:04 marco-c

We should now make sure the screenshots are the same in size. Maybe we need to collect them in a VM or something like that to make sure everyone is collecting the sime size. Or maybe we can find another way to ensure it.

marco-c avatar Apr 11 '18 17:04 marco-c

#184 might fix this.

marco-c avatar Dec 07 '18 16:12 marco-c