VisualCeption icon indicating copy to clipboard operation
VisualCeption copied to clipboard

[FEATURE] Improve support for pixel ratio > 1

Open koehnlein opened this issue 1 year ago • 1 comments

The first part of the PR improves generating screenshots for all devices with pixel ratio > 1. The lines https://github.com/koehnlein/VisualCeption/commit/c15c2944fd39e10fcb848a647eae6ad148fc096f#diff-23be3accec9cccd7a4b66e668a0a62586dec7eb7f4d2fc2b47419a46c6f2feb1R508-R513 include the pixel ratio when calculating the image cropping. Before this change, e.g. with "pixel ratio = 2", only the upper left quarter of the requested area was kept after cropping.

The second part is a new configuration option, described in readme.md:

downscalePixelRatio (default: false) automatically downscales screenshots to the pixel ratio "1". This can be helpful if you or your team are running the test on devices with different pixel densities. When this feature is enabled, screenshots from devices with higher pixel densities are automatically resized to provide more comparable images. Please note that scaled images will never be absolutely identical to the original, you need to set "maxiumDeviation" carefully if you want to pass your tests.

koehnlein avatar May 25 '23 12:05 koehnlein

@nixdrey could you say if this feature is related to one in your branch? #82 What do you think, should it be merged?

DavertMik avatar Apr 15 '24 11:04 DavertMik