Ubuntu – Use Pictures for an Image object in QML for Ubuntu Touch


I'm trying to use an image file from the main Pictures directory (/home/phablet/Pictures) for an AnimatedIMage/Image object however it says error reading file. I've tried two paths already but neither worked. I know I can simply include the images in my application but I want to use different images on the go. Thanks.

        id: gifVegeta
        anchors.fill: parent
        source: '/home/phablet/Pictures/vegeta_charge.gif'
       //source: 'file:///home/phablet/Pictures/vegeta_charge.gif'

Best Answer

I'm afraid you can't: your application is confined, and cannot access any files under the ~/Pictures directory. More info about this topic at https://developer.ubuntu.com/en/apps/platform/guides/app-confinement/