davidedmundson added inline comments.

INLINE COMMENTS

> switcherbackend.cpp:161
> +
> +            if (width <= 0) {
> +                width = 320;

"The requestedSize corresponds to the Image::sourceSize requested by an Image 
item. If requestedSize is a valid size, the image returned should be of that 
size."

source size isn't set which puts you always in this path

> switcherbackend.cpp:181
> +                KIO::filePreview(list, QSize(width, height));
> +            job->setScaleType(KIO::PreviewJob::Scaled);
> +            job->setIgnoreMaximumSize(true);

why not ScaledAndCached?

> switcherbackend.cpp:191
> +                        if (m_requestedSize.isValid()) {
> +                            image = image.scaled(m_requestedSize);
> +                        }

is this needed?

1. KIO is set to scaled anyway, so will resize it.
2. the QML code can resize the image at an openGL level by setting an 
appropriate fillMode.

The above two will keep aspect ratio properly.

REPOSITORY
  rPLASMADESKTOP Plasma Desktop

BRANCH
  Plasma/5.8

REVISION DETAIL
  https://phabricator.kde.org/D2810

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: ivan, #plasma, davidedmundson, mart
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas

Reply via email to