Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gvfs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 420
    • Issues 420
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gvfs
  • Issues
  • #648
Closed
Open
Issue created Sep 29, 2022 by Alexandr Teliatnikov@Alter

GVFS MTP uploaded images are not indexed by Android gallery

If image file are written to Android device via fuse mount point, they are not indexed correctly. They are not visible in Gallery and other apps, however file managers can see them. Then can also be selected directly, but not with Gallery. Some tricks with manual indexing/Rescan tools help. If image files are sent to Android phone via GUI (Nautilus), they immediately appear in Gallery and are visible for all apps.

The problem is caused by mtpfile->filetype = LIBMTP_FILETYPE_UNKNOWN in gvfs/daemon/gvfsbackendmtp.c, do_create() It prevents android indexer from handling new files correctly.

Correct indexing happens when sending via GUI (Nautilus) which use do_push() with explicitly specified mtpfile->filetype derived from mime type of source file.

Other tools those upload files correctly and examples in libmtp set mtpfile->filetype according to filename/extension. It would be great to implement such mechanism in GVFS MTP

adb logs:

09-29 14:44:41.838 19668 25267 D MtpServer: path: /storage/emulated/0/Download/DSCN1429.JPG parent: 17 storageID: 00010001
09-29 14:44:41.864 19668 25267 D skia    : --- Failed to create image decoder with message 'unimplemented'
vs
09-29 14:49:25.575 19668 25267 D MtpServer: path: /storage/emulated/0/Download/DSCN1429.JPG parent: 17 storageID: 00010001
09-29 14:49:25.688 19668 25267 W ExifInterface: Skip the tag entry since tag number is not defined: 34864
09-29 14:49:25.688 19668 25267 W ExifInterface: Skip the tag entry since tag number is not defined: 2
09-29 14:49:25.688 19668 25267 W ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
09-29 14:49:25.689 19668 25267 I chatty  : uid=10031(com.android.providers.media) MtpServer identical 2 lines
09-29 14:49:25.689 19668 25267 W ExifInterface: Stop reading file since a wrong offset may cause an infinite loop: 0
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking