Custom URL schemes support (e. g. internet) for source in nemo-qml-plugin-thumbnailer

Nemo-qml-plugin-thumbnailer’s Thumbnail uses URL for a source, but unlike Image only supports local paths. For example, this code shows nothing on the screen:

Thumbnail {
    source: "https://sailfishos.org/content/uploads/fbrfg/apple-touch-icon.png"
    sourceSize.width: Theme.iconSizeLarge
    sourceSize.height: Theme.iconSizeLarge
}

And with the provider, this code throws an error:

Image {
    source: "image://nemoThumbnail/https://sailfishos.org/content/uploads/fbrfg/apple-touch-icon.png"
    sourceSize.width: Theme.iconSizeLarge
    sourceSize.height: Theme.iconSizeLarge
}

I could of course workaround this by caching images myself and using normal Image, and I probably will. But I think that the native solution should have this fixed.

I also came across this issue a while ago, and tried SocialImageCache (which is not striclty intended for this use, but does have exactly the functionality of caching remote images).

I never continued my search for a solution, but I believe the " privileged" part can be solved using Launcher permissions, placing a file in /usr/share/mapplauncherd/privileges.d/harbour-storeman/app-name.privileges, and adding p, and i privileges:

/usr/bin/app-name,p,i

Never tried this, though

Anyway, perhaps one could use the code from libsocialcache/src/qml/generic at master · sailfishos/libsocialcache · GitHub, decouple it from all the Accounts stuff, and have a generic QML caching solution.

3 Likes

This could be of utility for caching stuff like avatars in tooter …

Thank you everyone. I decided to write a cache system myself with path being StandartPaths.cache.