Gallery requesting multiple video thumbnails when opening photo

Bug #1460993 reported by Michi Henning
14
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

Bug Description

I just took two short videos and four photos on the phone. When I look at the events page in the gallery app, I see thumbnails for the these just fine. I'm also tracing the requests that are made to the thumbnailer. When I tap on one of the photos, I see the following requests fired at the thumbnailer all at once (within one or two tenths of a second):

Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(216, 216)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(216, -1)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(231, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(256, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(291, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(341, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(402, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(477, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(558, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(657, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(768, 0)
Create thumbnail for "/home/phablet/Pictures/com.ubuntu.camera/image20150602_073643136.jpg" at size QSize(768, 1222)

This is horribly wasteful because the app retrieves the same image a dozen times. But, worse, we will cache thumbnailer in twelve different sizes for that same single image because we are being asked for a different size each time.

Also note that requests with width or height < 0 are interpreted to mean "as large as possible". The second request above consequently causes the image to be cached in its full size (unless it's larger than 1920, in which case we limit it to 1920x1920 bounding box).

Something seems definitely wrong here. The multiple requests are wasteful, and the different sizes mean that the cache is far less effective than it could be.

Related branches

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

These requests would have come from an Image component that sets sourceSize. And given the progression of sizes, it sounds like the sourceSize is being altered as part of a transition animation.

With the new thumbnail cache, that is going to lead to the image being re-loaded over and over as well as filling up the cache with images that are unlikely to be requested again (since another run of the transition might end up picking different points).

Ideally you'd keep sourceSize static, so the thumbnail is loaded once, and then the intermediate images are handled on the OpenGL side.

Thomas Strehl (strehl-t)
Changed in canonical-devices-system-image:
milestone: none → ww24-2015
milestone: ww24-2015 → ww26-2015
importance: Undecided → High
Revision history for this message
Michi Henning (michihenning) wrote :

BTW, this also causes a nasty flicker in between the tap and the full-size image because, every now and then, the rendering engine seems to get a foot in and manages to render (very briefly) one or two of the intermediate images. Fixing the animation bug would also get rid of the flicker.

Thomas Strehl (strehl-t)
Changed in canonical-devices-system-image:
assignee: nobody → Bill Filler (bfiller)
Changed in gallery-app:
importance: Undecided → High
Changed in gallery-app (Ubuntu):
assignee: nobody → Arthur Mello (artmello)
importance: Undecided → High
Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: ww26-2015 → ww28-2015
status: New → Confirmed
tags: added: qsize
tags: added: invalid-qsize
removed: qsize
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
Bill Filler (bfiller)
Changed in gallery-app (Ubuntu):
status: Confirmed → In Progress
Changed in gallery-app:
status: New → In Progress
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
gallery-app (0.0.67+15.10.20150706-0ubuntu1) wily; urgency=medium

  [ Arthur Mello ]
  * Disable unused GalleryPhotoComponent so we stop doing unnecessary
    request to thumbnailer (LP: #1460993)

  [ CI Train Bot ]
  * Resync trunk.

 -- CI Train Bot <email address hidden> Mon, 06 Jul 2015 16:35:36 +0000

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

It does not look like this this bug was fixed. I'm still seeing multiple requests for a single image.

Go to events page in the gallery app and tap on a photo. Displaying that single photo sends multiple requests to the thumbnailer:

thumbnailer-service: [01:01:02.355] "thumbnail: /home/phablet/Videos/com.ubuntu.camera/video20150720_010015553.mp4 (0,0): 0.009003 sec (FULL-SIZE HIT)"
thumbnailer-service: [01:01:02.378] "thumbnail: /home/phablet/Videos/com.ubuntu.camera/video20150720_010015553.mp4 (1060,1060): 0.023805 sec (FULL-SIZE HIT)"
thumbnailer-service: [01:01:02.383] "thumbnail: /home/phablet/Videos/com.ubuntu.camera/video20150720_010015553.mp4 (1222,1060): 0.010407 sec (FULL-SIZE HIT)"
thumbnailer-service: [01:01:02.400] "thumbnail: /home/phablet/Videos/com.ubuntu.camera/video20150720_010015553.mp4 (1222,1222): 0.025453 sec (FULL-SIZE HIT)"
thumbnailer-service: [01:01:02.454] "thumbnail: /home/phablet/Videos/com.ubuntu.camera/video20150720_010004143.mp4 (1222,1222): 0.004059 sec (FULL-SIZE HIT)"

Note that I'm seeing this every time I tap on a *photo*. However, the thumbnail requests are for one of the videos I took. It looks like the gallery app is asking for thumbnails for *video* files every time I tap on a *photo*.

Also, the request for (0,0) is problematic. It means "Give me the image at full size" (bounded to a 1920 box). A full-size image is most definitely *not* a thumbnail. The gallery app shouldn't be asking for "thumbnails" at full size. All this does is waste disk space and make the cache less effective. Instead, for the full-size image, the gallery app should be reading the image file directly, I would think?

Changed in gallery-app (Ubuntu):
status: Fix Released → Confirmed
Changed in canonical-devices-system-image:
status: Fix Released → Confirmed
Revision history for this message
Bill Filler (bfiller) wrote :

yes I am seeing the same thing. for some reason we are incorrecty asking for multiple video thumbnails when opening a single photo. We've fixed the problem with photo requesting multiple thumbnails but apparently did not fix the video case.

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

Just to add to this: if the gallery app wants show a still of a video at full size, asking for a thumbnail at (0,0) actually makes sense because there is no sensible way for the gallery app to pull out a still frame. For photos, it would be nice if the gallery app were to open the image file directly. That way, we don't end up with the image on disk twice (once in the original file, and once inside the thumbnail cache).

Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: ww28-2015 → ww34-2015
summary: - Multiple thumbnail requests for a single image
+ Gallery requesting multiple video thumbnails when opening photo
Bill Filler (bfiller)
Changed in gallery-app (Ubuntu):
status: Confirmed → In Progress
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Bill Filler (bfiller)
Changed in gallery-app (Ubuntu):
status: In Progress → Fix Released
no longer affects: gallery-app
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.