Preview with strange time for MTP pic

Bug #1482735 reported by Allan LeSage
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Photos Scope
Invalid
High
Unassigned
mediascanner2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Just in the process of automating a test or two:

TEST CASE
* Transfer a pic to device
* Scroll to photos scope
* Open preview
EXPECTED
Time matches change time for file on host
ACTUAL
Time does not match change time of file on host but close :)

I'll add some logs and a screenie. Arale r77 FWIW.

On device
phablet@ubuntu-phablet:~$ stat Pictures/Phase-Lumiere-II-by-Otto-Piene-1961.jpg
  File: ‘Pictures/Phase-Lumiere-II-by-Otto-Piene-1961.jpg’
  Size: 801449 Blocks: 1568 IO Block: 4096 regular file
Device: b310h/45840d Inode: 1066565 Links: 1
Access: (0664/-rw-rw-r--) Uid: (32011/ phablet) Gid: (32011/ phablet)
Access: 2015-08-07 11:16:19.379499130 -0500
Modify: 2015-08-07 11:16:19.409499130 -0500
Change: 2015-08-07 11:16:19.409499130 -0500
 Birth: -

On host
alesage@triacetate:~/workspace/Canonical/a-team/photos-scope-opens-gallery$ stat ~/Pictures/Phase-Lumiere-II-by-Otto-Piene-1961.jpg
  File: ‘/home/alesage/Pictures/Phase-Lumiere-II-by-Otto-Piene-1961.jpg’
  Size: 801449 Blocks: 1568 IO Block: 4096 regular file
Device: 803h/2051d Inode: 787658 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ alesage) Gid: ( 1000/ alesage)
Access: 2015-08-07 11:16:19.446116080 -0500
Modify: 2012-01-31 11:12:23.225834745 -0600
Change: 2012-01-31 11:12:23.225834745 -0600
 Birth: -

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

I would use the exiv2 command to see the image file's meta data. For example, there is this field, whose value has nothing really to do with the file creation/modification time from the file system (stat commmands and etc.) point of view:

$ exiv2 image20150206_075322374.jpg | grep -i timestamp
Image timestamp : 2015:02:06 07:53:25

The My Photos scope (a child scope of Photos scope) obtains info about images from a system api (mediascanner-2.0), not directly from file system oriented data.

Changed in photos-scope:
status: New → Triaged
importance: Undecided → High
Revision history for this message
James Henstridge (jamesh) wrote :

The MediaFile.getDate() method of media scanner will return the date found in the metadata if available. So if the picture has EXIF metadata (which you'd expect for photos coming from a camera), the returned date won't necessarily match the file mtime. This is consistent with how we handle dates for music files.

It isn't surprising that the date is close but not exactly the same as the mtime for locally shot photos: some time would elapse between when camera-app reads the current time to store in the metadata and when it finishes writing the photo to disk.

We have a second method call getModificationTime() that will return the mtime for a particular file. This was likely added after the photos scope was initially developed. It was added in order to let us query for the most recently added songs in the music scope, but could also be used for the photo scope preview if you really want to ignore the date from the metadata.

Changed in mediascanner2 (Ubuntu):
status: New → Invalid
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Based on Jame's explanation, this is invalid for photos-local scope too.

Changed in photos-scope:
status: Triaged → Invalid
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.