Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. iOS: access files in asset library
Forum Updated to NodeBB v4.3 + New Features

iOS: access files in asset library

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 402 Views
  • 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.
  • H Offline
    H Offline
    Holger Gerth
    wrote on 25 Nov 2020, 16:05 last edited by
    #1

    I'm currently porting my app to iOS.

    One functionality is that the user can select images via QML FileDialog from the device photo gallery and add them to the app. On Android this is working fine with QFile, QFileInfo or QImage and the provided content-URL, if the necessary rights are granted.

    In iOS FileDialog provides a asset-library URL like this one:
    assets-library://asset/asset.JPG?id=D3232E42-FAEF-4510-B097-79950E0BE5DB&ext=JPG

    Using this with QFileInfo, exists() is true for some files and false for the others. If it's true, then QFileInfo doesn't contain any usable information. For example file size is 0, creation time is invalid and mime type is application/x-zerosize.

    In info.plist the following rights are requested:
    <key>NSCameraUsageDescription</key>
    <string>The app wants to access the camera..</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>The app wants to access the photo gallery.</string>

    I'm using Qt 5.15.1 and testing with iOS 14.2 (emulator).

    Any ideas what I'm missing? Or isn't it possible to access these files via QFile?

    1 Reply Last reply
    1

    1/1

    25 Nov 2020, 16:05

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved