Problems accessing a picture on the iOS 10.2.1 using Qt 5.8



  • So I am trying to access a file selected by the QML engine (so I know the file exists):

        QString path = "file:assets-library://asset/asset.PNG?id=FF324EBC-DC50-4F6A-8F72-E93CB26D91F5&ext=PNG";
    
        QFile file1(path);
        if (!file1.exists())
            qCritical() << "file1 not found";
    
        QFile file2(QUrl(path).path());
        if (!file2.exists())
            qCritical() << "file2 not found";
    
        QFile file3(QUrl(path).toLocalFile());
        if (!file3.exists())
            qCritical() << "file3 not found";
    
    

    And I get the 3 error messages. It used to work before but I guess the upgrade of iOS to 10.2.1 messes things up.


  • Lifetime Qt Champion

    Hi,

    Are you sure your id parameter is correct ?



  • Yes because it is a picture I select from the V-Play's camera roll. I hard coded the filename for this example.

    What's more funny is if I try to print recursively the contents of the root folder in C then I get the following listing (there is no such "asset" subfolder):

    [.Trashes]
    [Applications]
    [Developer]
    [Applications]
        [MobileReplayer.app]
        [_CodeSignature]
        [LaunchScreen.storyboardc]
        [PlugIns]
            [EAGLReplayControllerSupport.mrplugin]
            [_CodeSignature]
            [MTLReplayControllerSupport.mrplugin]
            [_CodeSignature]
    [Library]
        [Daemons]
        [PlugIns]
            [DTODRAssetStatus.bundle]
            [_CodeSignature]
            [IDEDebugGaugeDataProviders.bundle]
            [_CodeSignature]
            [en.lproj]
            [UIAutomation.bundle]
            [_CodeSignature]
        [Frameworks]
        [XCTest.framework]
            [_CodeSignature]
            [en.lproj]
            [Modules]
            [TextBasedStubs]
            [XPCServices]
            [xctestSymbolicator.xpc]
                [_CodeSignature]
            [XCUIRecorderService.xpc]
                [_CodeSignature]
        [LaunchDaemons]
        [Lockdown]
        [ServiceAgents]
        [PreferenceBundles]
        [Developer Settings.bundle]
            [_CodeSignature]
            [en.lproj]
        [PrivateFrameworks]
        [AccessibilityAudit.framework]
            [_CodeSignature]
            [Resources]
            [AccessibilityAuditCategories.bundle]
                [_CodeSignature]
                [Base.lproj]
            [AXAuditAXUIService.axuiservice]
                [_CodeSignature]
            [en.lproj]
        [ARMDisassembler.framework]
            [_CodeSignature]
        [DTDDISupport.framework]
            [_CodeSignature]
            [en.lproj]
        [DTPerformanceSession.framework]
            [_CodeSignature]
        [DTXConnectionServices.framework]
            [_CodeSignature]
            [Modules]
        [DVTInstrumentsFoundation.framework]
            [_CodeSignature]
            [XPCServices]
            [com.apple.dt.instruments.dtactivity.xpc]
                [_CodeSignature]
            [com.apple.dt.instruments.dtarbiter.xpc]
                [_CodeSignature]
            [com.apple.dt.instruments.dtdtrace.xpc]
                [_CodeSignature]
            [com.apple.dt.instruments.dtsecurity.xpc]
                [_CodeSignature]
        [DVTInstrumentsUtilities.framework]
            [_CodeSignature]
        [GLTools.framework]
            [_CodeSignature]
        [GLToolsCore.framework]
            [_CodeSignature]
        [GPUTools.framework]
            [_CodeSignature]
        [GPUToolsCore.framework]
            [_CodeSignature]
        [GPUToolsiOS.framework]
            [_CodeSignature]
            [PlugIns]
            [EAGLCaptureAPISupport.gdtdplugin]
                [_CodeSignature]
            [MTLCaptureAPISupport.gdtdplugin]
                [_CodeSignature]
        [GPUToolsPlayback.framework]
            [_CodeSignature]
        [MTLToolsDeviceSupport.framework]
            [_CodeSignature]
        [ScriptProcessor.framework]
            [_CodeSignature]
            [en.lproj]
        [UIAutomation.framework]
            [_CodeSignature]
    [System]
        [Library]
        [CoreServices]
    [usr]
        [bin]
        [lib]
        [swift]
            [iphoneos]
        [libexec]
        [GPUToolsiOS.framework]
            [_CodeSignature]
            [PlugIns]
            [EAGLCaptureAPISupport.gdtdplugin]
                [_CodeSignature]
        [share]
        [kpep]
        [man]
            [man1]
    [Library]
    [System]
    [bin]
    [cores]
    [dev]
    [private]
    [sbin]
    [usr]
    
    

    I mean what is this?



  • All I know so far is that the AssetLibrary.framework is deprecated and replaced by the Photos.framework. This is most likely what is going on here.



  • Ok today it works. I didn't do anything except rerunning "qmake". Sorry for the noise...!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.