Comment 10 for bug 1467740

Revision history for this message
James Henstridge (jamesh) wrote :

To be clear, what I suggested was to use the height and width unchanged rather than multiplying by 4: that would improve the quality over the current code while not blowing out the memory requirements of providing huge images.

As a longer term solution to get images of the required quality, I suggested the following on IRC:

We've got enough information on the back end to provide an image of the proper size so it can be cropped to the desired dimensions without scaling. So the idea is to do something like this:

1. If the dash sees a URI like image://albumart, artistart or thumbnailer, add a crop=1 parameter to the end before using it as the source for the Image, and set sourceSize to the the cropped image dimensions.
2. In the image provider, if the crop parameter is included, interpret requestedSize as the desired crop dimensions rather than a bounding box.
3. return an image that can be cropped to those dimensions without scaling.

Qt already seems to handle the case when an image provider returns an image larger than requestedSize, so I imagine this would work okay.

This is a bit of a hack, but no more so than the whole CroppedImageMinimumSourceSize component. I agree that it'd be nice if Qt made it easier to load an image at an appropriate size to use with PreserveAspectCrop.