UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Content-hub import Pictures

    Scheduled Pinned Locked Moved App Development
    3 Posts 3 Posters 590 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • F Offline
        fulvio
        last edited by fulvio

        Hi all,
        i'm making an App that must use Pictures stored on the device.
        Using my app the user choose the Pictures to be imported. To do that I'm using the Content-hub.
        Picture selection and importing works correctly.
        The problem is that each selected and imported image is placed in that folder:
        '/home/.cache/<MyApp>.fulvio/HubIncoming/'
        (where <MyApp> is the App id of my application).
        That cause duplication of the images (and space consumption) because the same image is placed in the original folder (where the user pickup it) and in the above one.

        For my purpose is necessary only have the path/url to the chosen images, (not also a copy of the image under /home/.cache/<MyApp>.fulvio/HubIncoming) so that in my app i can do a thing like this:

        Image {
        source: <the link to the Image>
        }

        Is possible ?

        Thanks !

        1 Reply Last reply Reply Quote 0
        • N Offline
          nanu-c
          last edited by nanu-c

          I think that's the idea of the content hub by design. Every app can only work with his/her own chunks of bits, so if you make a photo send with signal and telegram, then you have 3 copies of that file, because if you delete it on the phone, signal and telegram are still using their copy...

          Image {
          source: <the link to the Image>
          }
          

          is possible in unconfined profile in apparmor apps, but then your app needs a manual approval in the open store

          1 Reply Last reply Reply Quote 0
          • CiberSheepC Offline
            CiberSheep
            last edited by

            The copy in HubIncoming is deleted after the device is restarted. You must copy the picture url into the folder you want to use it (under your app).
            You could access any filie in the system if you unconfined your app but it's considered a bad practice. That's why the Content Hub serves you the image for you 🙂

            Another planet, another time, another universe!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post