Thumbnails: make thumbnail generation dpr-aware
Needs ReviewPublic

Authored by meven on Fri, May 8, 10:37 AM.

Details

Reviewers
dfaure
broulik
sitter
ngraham
Group Reviewers
Frameworks
Summary

Thumbnail ioslave can now receive a devicePixelRatio metadata parameter, that it will pass to its thumbnail creators plugins implementing ThumbCreatorV3.
It updates the directory thumbnail generation.

Port image, jpeg, djvu, krita, svg, text to new ThumbCreatorV3.

Depends on D29397

Test Plan

Manualy tested
With dolphin D29525

Diff Detail

Repository
R320 KIO Extras
Branch
thumbnail-dpr
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26597
Build 26615: arc lint + arc unit
meven created this revision.Fri, May 8, 10:37 AM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptFri, May 8, 10:37 AM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
meven requested review of this revision.Fri, May 8, 10:37 AM
meven updated this revision to Diff 82332.Sat, May 9, 6:24 AM

Store thumbnails with dpr 2 in @2x folders

You do seem to calculate the deviceWidth and height an awful lot, it makes reading a bit clunky. I'd much rather have the multiplication done once and then always use the var instead. In fact, perhaps it'd make sense to have createV3 feed the values into the implementations? Currently they all repate the same two lines over and over.

thumbnail/djvucreator.cpp
61

Surely multiplication results need converting to int. That being said, you do multiply below again, so maybe just move maxWidth/Height up here.

thumbnail/thumbnail.cpp
774

Var naming is a bit inconsistent across the code base now. In the implementations there are maxWidth/H that are device-adjusted but in here they are not. Not a huge concern, just noticed.

meven added inline comments.Wed, May 13, 3:05 PM
thumbnail/thumbnail.cpp
774

Will take care

791

Not used can be removed.

794

Because of line above scaleDownImage can never happen.
Can probably be removed.