Make artwork selection more standards-compliant and smarter
Changes PlannedPublic

Authored by broulik on Apr 22 2019, 12:13 PM.

Details

Reviewers
fvogt
Group Reviewers
Plasma
Summary

According to specification sizes is a space-separated list of sizes which are separated by x or X.
Also, try to find a thumbnail closest to 512x512 to avoid loading huge thumbnails.

Test Plan

master
No longer tries to load a Full HD YouTube thumbnail here anymore
Still works when there's just one image with a size
Still works when there's just one image without a size

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Apr 22 2019, 12:13 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 22 2019, 12:13 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 22 2019, 12:13 PM
broulik added a reviewer: fvogt.

+1, makes sense for the stable branch.

fvogt requested changes to this revision.Apr 22 2019, 7:31 PM
fvogt added inline comments.
host/mprisplugin.cpp
476–477

AFAICT this will not work as expected in cases such as 1920x1080 followed by 256x256.

This revision now requires changes to proceed.Apr 22 2019, 7:31 PM
broulik planned changes to this revision.Apr 22 2019, 8:37 PM
broulik updated this revision to Diff 56800.Apr 23 2019, 8:08 AM
broulik retitled this revision from Limit thumbnail size to Make artwork selection more standards-compliant and smarter.
broulik edited the summary of this revision. (Show Details)
broulik edited the test plan for this revision. (Show Details)
fvogt requested changes to this revision.Apr 23 2019, 9:15 AM
fvogt added inline comments.
host/mprisplugin.cpp
489

Why change this line? With auto it was easier to read, just the & should be removed for clarity. Now it also accepts `xx42xx42xx" as valid size, while it didn't before.

498

That's still equal to std::numeric_limits<qreal>::max() due to lacking precision.

510

This algorithm only looks at the aspect ratio of the image, not the resolution. For 4096x4096, 1024x1024 and 512x512 you'll get the same effectiveSamples value, so it will load huge thumbnails again.

This revision now requires changes to proceed.Apr 23 2019, 9:15 AM
broulik planned changes to this revision.Apr 24 2019, 7:02 AM