Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem displaying images from the phone gallery
Qt 6.11 is out! See what's new in the release blog

Problem displaying images from the phone gallery

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 2.0k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    strekazoid
    wrote on last edited by
    #1

    When I try to retrieve images from the phone gallery, I get this:

    [Qt Message] file:///C:/Private/e4b60ad7/qml/gallery/MainPage.qml:28:25: QML Image: Error decoding: file:///e:/images/camera/201010/201010a0/06102010015.jpg: Unable to read image data

    I suspect this is because of the missing capability. However, neither of the mentioned capabilities helped:

    @# Allow network access on Symbian
    symbian:TARGET.CAPABILITY += NetworkServices ReadUserData UserEnvironment@

    Here is a code snippet on how I try to retrieve and display images:

    @import QtQuick 1.0
    import com.nokia.symbian 1.0
    import QtMobility.gallery 1.1

    Page {
    id: mainPage

    Rectangle {
        id: rectangle1
        color: "#ffffff"
        anchors.fill: parent
    
        ListView {
            id: list_view1
            x: 96
            y: 158
            anchors.fill: parent
            delegate: Item {
                x: 5
                height: 40
                Row {
                    id: row1
                    spacing: 10
                    Rectangle {
                        width: 100
                        height: 100
    
                        Image {
                            anchors.fill: parent
                            source: url
                        }
                    }
    
                }
            }
            model: DocumentGalleryModel {
                rootType: DocumentGallery.Image
                properties: ["url"]
                /*filter: GalleryWildcardFilter {
                    property: "fileName";
                    value: "*.*";
                }*/
            }
        }
    }
    

    }@

    This filter thing was also giving me errors about "unsupported value of filter property", so I had to disable it. It seems that now I get my files, but decoding those fails. What am I missing here?

    1 Reply Last reply
    0

    • Login

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