Make artwork selection more standards-compliant and smarter
Changes PlannedPublic

Authored by broulik on Mon, Apr 22, 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.Mon, Apr 22, 12:13 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMon, Apr 22, 12:13 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Mon, Apr 22, 12:13 PM
broulik added a reviewer: fvogt.

+1, makes sense for the stable branch.

fvogt requested changes to this revision.Mon, Apr 22, 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.Mon, Apr 22, 7:31 PM
broulik planned changes to this revision.Mon, Apr 22, 8:37 PM
broulik updated this revision to Diff 56800.Tue, Apr 23, 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.Tue, Apr 23, 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.Tue, Apr 23, 9:15 AM
broulik planned changes to this revision.Wed, Apr 24, 7:02 AM