photos edited in gallery do not display edited in "My Photos" scope

Bug #1384243 reported by Kyle Nitzsche
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Savilerow project
Fix Released
Critical
Ethan Chang
Thumbnailer
Invalid
Undecided
Unassigned
gallery-app (Ubuntu)
New
Undecided
Unassigned
mediascanner2 (Ubuntu)
New
Undecided
Unassigned
unity-scopes-api (Ubuntu)
Invalid
Undecided
Unassigned
unity-scopes-shell (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I opened a photo from My Photos scope Preview > Open in the gallery. Rotate it. When I return to the scope, fully refreshed, the photo does not display rotated.

Wait for scope to exit and then refresh it: still not rotated.

Restart unity8-dash: now it displays rotated.

I would expect dash toolkit to honor the edited state of a photo and display it rotated as appropriate.

Note:
Gallery app uses a URI that starts with image://thumbnailer/absPathToPhoto to display photos with correct rotation. However, scopes require the URI starts with photo://. Without that, the Open button on the preview does not open the photo in gallery.

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

Not sure who's to blame here. I suspect it's not unity-scopes-api, but more likely some interaction between the shell and the scope implementation.

Changed in unity-scopes-api (Ubuntu):
status: New → Invalid
Revision history for this message
Michi Henning (michihenning) wrote :

I just tried this with the new thumbnailer, which isn't to blame. Basically, what's happening is that, after rotating the photo, the image file under ~/Pictures/com.ubuntu.camera is correctly re-writting, including its rotation information. If you look at the rotated photo with the gallery app, it is correctly shown with its new rotation, meaning that the thumbnailer correctly realised that the image was updated and generated a new thumbnail.

However, the photo scope fails to realize that the image was touched. It looks like the photo scope does its own thumbnailing, but ignores the rotation data or some such.

At any rate, this isn't a problem in the thumbnailer.

Changed in unity-scopes-shell (Ubuntu):
status: New → Invalid
Changed in thumbnailer:
status: New → Invalid
Changed in savilerow:
importance: Undecided → Critical
summary: - photos rotated in gallery do not display rotated in scope
+ photos rotated in gallery do not display rotated in "My Photos" scope
Changed in savilerow:
status: New → Confirmed
importance: Critical → Medium
importance: Medium → High
Changed in savilerow:
importance: High → Critical
description: updated
Revision history for this message
Kyle Nitzsche (knitzsche) wrote : Re: photos rotated in gallery do not display rotated in "My Photos" scope

@Michi & @Pawel: Is the problem that unity8 simply continues to use the original cached result because it has no way to know it has changed (the URI is unchanged)?

Note: the scope uses image://thumbnailer/PATH to display the result.Art.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Not surprisingly: the same thing happens with other edits in Gallery, for example crop.

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

> Is the problem that unity8 simply continues to use the original cached result

Almost certainly, yes. The thumbnailer will realise that the file has changed an it will re-create the thumbnail for it, but only if someone actually asks the thumbnailer for the thumbnail again.

I suspect that this could be fixed the same way you fixed it during the spring, by appending some suffix to the image URL that changes each time a photo is edited. (A counter might work.)

summary: - photos rotated in gallery do not display rotated in "My Photos" scope
+ photos edited in gallery do not display edited in "My Photos" scope
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

@Michi:

Appending a timestamp param (image://thumbnailer/PATH&TIMESTAMP) to every photo's art uri accomplishes the goal: on refresh edited photos display edited in surfafed results

I assume this approach does not force the thumbnailer to rethumbnail every photo every time (even though the URIs are now always new) because when there has been no edit of the photo the file modification time has not changed. Please correct me if this assumption is incorrect.

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

That sounds good. The thumbnailer will re-thumbnail if and only if mtime or ctime have changed. So, if you append the timestamp only when there actually was an edit, that will trigger a re-thumbnail only when the time stamp changes.

And setting the image source to the modified URL invalidates the QML cache, so QML triggers a refresh of the thumbnail.

This all sounds good. If you want to verify that it behaves as you expect, just run a trace on dbus.log, and you'll be able to exactly when the thumbnailer does any work for that image.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

fixed with com.canonical.scopes.photos-local_1.27_armhf.click in clicks branch.

Penk, can you please arrange for QA?

Changed in savilerow:
status: Confirmed → Fix Committed
assignee: nobody → Penk Chen (penk)
Penk Chen (penk)
Changed in savilerow:
assignee: Penk Chen (penk) → Elsa Wang (elsawang)
Revision history for this message
Elsa Wang (elsawang) wrote :

@Ethan, could you please verify this issue with the latest click package, thanks!

Changed in savilerow:
assignee: Elsa Wang (elsawang) → Ethan Chang (ethan.chang)
Revision history for this message
Jin (jindallo) wrote :

Hello Ethan,

Please find attached one Kyle pushed,
thanks.

Revision history for this message
Ethan Chang (ethan.chang) wrote :

Verified with photos-local 1.27.

tags: added: cqa-verified
tags: added: ota10
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

David Morely found that in the latest latest bq-aquaris.en-proposed image no photos show with 1.27 in my photos, which I confirm in build 283 & 286. Strange, since both I and Ethan found 1.27 worked. Reopening bug.

Changed in savilerow:
status: Fix Committed → Confirmed
Dave Morley (davmor2)
tags: added: qa-silo
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Unity seems to need another slash now in the result art uri:

* "image://thumbnailer/pathtoimage" fails
* but "image://thumbnailer//pathtoimage" works

So I've adjusted the result art uri accordingly.

fixed in 1.28 attached to bug and pushed to clicks since this is probably needed for OTA10.

Changed in savilerow:
status: Confirmed → Fix Committed
Revision history for this message
Michi Henning (michihenning) wrote :

I'm surprised that this has ever worked, and works with the double slash possibly only by accident.

According to the doc (https://developer.ubuntu.com/en/apps/qml/tutorials/use-ubuntu-thumbnailer/), it should be

image://thumbnailer/file://pathtoimage

I strongly suspect that the fix really should be to include "file:" as above.

Changed in savilerow:
status: Fix Committed → Confirmed
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Ah, thanks Michi.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Attaching version 1.29 (also in clicks branch) to pick up the mod Michi recommends.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Apologies: please use 1.30 attached here and in clicks branch

Revision history for this message
Allan LeSage (allanlesage) wrote :

While testing tarballs discovering that the MTP use case isn't served by this fix, discussing with kyleN whether or not a new bug is needed.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Hi Allan,

This fix handles photos taken by the camera (then rotated in gallery) and photos downloaded through the browser(then rotated in gallery), to name two.

I am guessing this is therefore a different issue, perhaps something to do with MTP & mediascanner & gallery. Therefore, I think this needs a new bug and we can release with the current fix.

Changed in savilerow:
status: Confirmed → Fix Committed
Revision history for this message
Michi Henning (michihenning) wrote :

Added mediascanner2 because we don't know yet what's actually causing this.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Michi, This is a new issue now tracked in https://bugs.launchpad.net/savilerow/+bug/1562121

cheers

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

This was fix released a long time ago.

I tested version com.canonical.scopes.photos-local_1.38_armhf.click in clicks (which was in ota 13) and the photo rotated from gallery then displays rotated in photos-local (My Photos) scope.

Changed in savilerow:
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.