← Back to team overview

touch-packages team mailing list archive

[Bug 1467740] Re: Lots of thumbnail requests with invalid size

 

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.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to thumbnailer in Ubuntu.
https://bugs.launchpad.net/bugs/1467740

Title:
  Lots of thumbnail requests with invalid size

Status in thumbnailer package in Ubuntu:
  New
Status in unity8 package in Ubuntu:
  New

Bug description:
  When using scopes, the thumbnailer gets loads of requests with
  QSize(-1,-1) from the shell. For example, with a bunch of videos
  recorded, run up the video scope and go to "My Videos". The shell asks
  for a thumbnail at QSize(-1,-1) for the tiny thumbnail that appears to
  the left of each list entry.

  The problem with this is that the thumbnailer interprets this to mean
  "give me the largest size you can (limited to a 1920x1920 bounding
  box). That's very expensive, especially in terms of disk space,
  because that 1920 "thumbnail" ends up going into the cache, needlessly
  hogging space.

  We are about to add a qWarning message to the QML side that reports
  invalid QSize requests. For now, we are going to retain the old
  behavior, but this will turn into an error soon.

  The most effective way to use the thumbnailer is to simply ask for an
  image in the desired size, with neither width nor height of -1. The
  thumbnailer will efficiently produce a thumbnail for that. (We do lots
  of internal caching to avoid extracting or downloading a thumbnail
  unnecessarily.)

  The thumbnailer may deliver a thumbnail that is smaller than what was
  asked for (because it never up-scales) so, if asked for a thumbnail of
  size 256, it's guaranteed not to be larger, but might be smaller (if
  the original image is smaller than what was asked for).

  Could you please adjust the shell behavior to ask for specific, valid
  sizes only?

  Running a tail -f on ~/.cache/upstart/dbus.log allows you to see the
  requests as they are made. Each request shows the size that was asked
  for.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/thumbnailer/+bug/1467740/+subscriptions


References