<table><tr><td style="">antlarr created this revision.<br />antlarr added a reviewer: Plasma.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D3188" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This new version of the distance function simplifies the<br />
findPreferredImageInPackage method by using the aspect ratio in the<br />
calculation. Now, it won't only search for a wallpaper with the same<br />
aspect ratio, but will also choose one with the closest possible<br />
aspect ratio when a perfect match is not found.</p>

<p>Also, I separated the method that chooses the preferred image<br />
to not use KPackage in order to use it from a test application<br />
that tests the distance algorithm with all possible resolutions.</p>

<p>Test application that tests the Image::findPreferredImage method</p>

<p>The test initializes a list of available wallpaper image sizes,<br />
then a list of screen resolutions, and then executes<br />
Image::findPreferredImage to find out which is the preferred image<br />
in each case.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>I tested with different screen resolutions on a virtual machine with<br />
openSUSE Leap 42.2 RC1 and also included a commit that adds a test<br />
application (not built by default) that tests all possible resolutions.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rPLASMAWORKSPACE Plasma Workspace</div></div></div><br /><div><strong>BRANCH</strong><div><div>Plasma/5.8</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3188" rel="noreferrer">https://phabricator.kde.org/D3188</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>wallpapers/image/CMakeLists.txt<br />
wallpapers/image/image.cpp<br />
wallpapers/image/image.h<br />
wallpapers/image/testfindpreferredimage.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>antlarr, Plasma<br /><strong>Cc: </strong>plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>