Gallery app asks for same image multiple times at different sizes

Bug #1529452 reported by Michi Henning
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Bill Filler
gallery-app (Ubuntu)
Fix Released
High
Arthur Mello
thumbnailer (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I'm seeing this with image 342 from rc-proposed.

When starting the gallery app with around 300 photos in my Pictures folder, I just noticed the request sequence shown below. Note that all requests are for the same image and are issued pretty much all at once. (There is about half a second elapsed time between the first and the last request.) The requests keep changing the size only, starting at 342 and working their way down to 216. This is supremely inefficient because each of the requests results in a separate scaling operation. In addition, each of these requests ends up in the cache on disk, so this behavior really hammers the battery and reduces cache efficiency.

thumbnailer-service: [09:25:36.825] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (342,342): 0.044376 sec (MISS)"
thumbnailer-service: [09:25:36.899] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (341,341): 0.020540 sec (MISS)"
thumbnailer-service: [09:25:36.942] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (340,340): 0.034030 sec (MISS)"
thumbnailer-service: [09:25:37.068] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (338,338): 0.143506 sec (MISS)"
thumbnailer-service: [09:25:37.095] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (335,335): 0.154219 sec (MISS)"
thumbnailer-service: [09:25:37.126] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (332,332): 0.162185 sec (MISS)"
thumbnailer-service: [09:25:37.145] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (326,326): 0.172134 sec (MISS)"
thumbnailer-service: [09:25:37.167] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (318,318): 0.177231 sec (MISS)"
thumbnailer-service: [09:25:37.188] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (307,307): 0.181870 sec (MISS)"
thumbnailer-service: [09:25:37.205] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (292,292): 0.182084 sec (MISS)"
thumbnailer-service: [09:25:37.223] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (273,292): 0.183793 sec (MISS)"
thumbnailer-service: [09:25:37.238] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (273,273): 0.198290 sec (MISS)"
thumbnailer-service: [09:25:37.369] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (250,273): 0.313627 sec (MISS)"
thumbnailer-service: [09:25:37.391] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (250,250): 0.334533 sec (MISS)"
thumbnailer-service: [09:25:37.402] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (218,218): 0.317747 sec (MISS)"
thumbnailer-service: [09:25:37.405] "thumbnail: /home/phablet/Pictures/com.ubuntu.camera/image20151227_091023042.jpg (216,216): 0.310605 sec (HIT)"

Related branches

Changed in thumbnailer (Ubuntu):
status: New → Triaged
Revision history for this message
Michi Henning (michihenning) wrote :

This is really serious. I'm seeing around a dozen requests for each image (each request at a different size) when scrolling in the event view. I'm also seeing crashes. One way to reproduce seems to be to scroll all the way to the end of the event view and then scroll in the other direction. As soon as I try to go backwards from the end, I get a crash.

Changed in gallery-app (Ubuntu):
importance: Undecided → High
Changed in canonical-devices-system-image:
assignee: nobody → Bill Filler (bfiller)
importance: Undecided → High
milestone: none → backlog
status: New → Confirmed
Revision history for this message
Michi Henning (michihenning) wrote :

With about 30 images in the photo roll, after scrolling left and right in the event view a number of times, those 30 images result in nearly 700 thumbnails in the cache :-(

Bill Filler (bfiller)
Changed in gallery-app (Ubuntu):
assignee: nobody → Arthur Mello (artmello)
Changed in canonical-devices-system-image:
milestone: backlog → ww08-2016
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gallery-app (Ubuntu):
status: New → Confirmed
Arthur Mello (artmello)
Changed in gallery-app (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Michi Henning (michihenning) wrote :

BTW, it would probably be helpful to set the thumbailer trace to include hits in dbus.log when debugging this. Just run

gsettings set com.canonical.Unity.Thumbnailer log-level 2

(Without this, the log only shows misses and errors.)

Bill Filler (bfiller)
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gallery-app - 0.0.67+16.04.20160225.1-0ubuntu1

---------------
gallery-app (0.0.67+16.04.20160225.1-0ubuntu1) xenial; urgency=medium

  [ Arthur Mello ]
  * Add a timer to make sure all taken photos are added into collection
    in a batch (LP: #1521365)
  * Add missing pkg dependency for qtdeclarative5-ubuntu-thumbnailer0.1
    (LP: #1531604)
  * Fix action button calls on AP tests
  * Following some changes on thumbnailer image provider we need to
    handle Image.Error status for videos that are unable to load
    correctly (LP: #1542083)
  * Make sure to request a thumbnail big enough to handle all the
    possible sizes that way media items will not request a new one every
    time it changes its position. (LP: #1529452)
  * Remove photo-image-provider to use the one provided by ubunut-ui-
    extras Move photo-metadata from photoeditor to photo folder (LP:
    #1541210)
  * Set albums created from PopupAlbumPicker as not new, so they will
    not be deleted after editing (LP: #1483870)
  * Show a checkered background as a background for transparent images
    (LP: #1548855)

  [ Ken VanDine ]
  * Register with the content-hub for deb installs

 -- Bill Filler <email address hidden> Thu, 25 Feb 2016 18:01:21 +0000

Changed in gallery-app (Ubuntu):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Michi Henning (michihenning) wrote :

So, I've been trying to test this. But, with the latest rc-proposed image (385), gallery-app is still at revision 1260. Why has the fix not made it into the image?

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

It needs an API bump that is only in proposed so it did not go into the store yet which has been required to get to the image. The guys have a new approach so it should be in shortly. In the meantime bfiller can give you a click

Revision history for this message
Michi Henning (michihenning) wrote :

Thanks Pat! I got a click from Bill yesterday. I can install that OK on rc-proposed r382 for Mako but, when I run the gallery app, it just sits there with a white screen after startup and shows the little spinner in the center of the screen forever.

Is anyone else seeing this?

Revision history for this message
Michi Henning (michihenning) wrote :

I just re-tested with image 383 from rc-proposed and 2.9.1.1276 of gallery app. This is much better behaved now, thanks! I'm no longer seeing the redundant requests.

Changed in thumbnailer (Ubuntu):
status: Triaged → Invalid
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.