Comment 3 for bug 1550706

Revision history for this message
Michael Zanetti (mzanetti) wrote : Re: Thumbnails not working with qrc

I just confirmed this with a snippet of code:

Works:

Image {
  width: 100
  height: 100
  sourceSize: Qt.size(width, height)
  source: "/image.png"
}

Works:

Image {
  width: 100
  height: 100
  sourceSize: Qt.size(width, height)
  source: "image://thumbnailer/file:///image.png"
}

Works:

Image {
  width: 100
  height: 100
  sourceSize: Qt.size(width, height)
  source: "qrc:///image.png"
}

Fails:

Image {
  width: 100
  height: 100
  sourceSize: Qt.size(width, height)
  source: "image://thumbnailer/qrc:///image.png"
}

This throws the following error:

Thumbnailer: RequestImpl::dbusCallFinished(): D-Bus error: DBusInterface::GetThumbnail(): ap.png: unity::ResourceException: Thumbnailer::get_thumbnail():
    boost::filesystem::canonical: No such file or directory: "/image.png"
qrc:///Main.qml:19:5: QML QQuickImage: Thumbnailer: RequestImpl::dbusCallFinished(): D-Bus error: DBusInterface::GetThumbnail(): ap.png: unity::ResourceException: Thumbnailer::get_thumbnail():
    boost::filesystem::canonical: No such file or directory: "/image.png"

=> As stated before, putting media into a qrc file is the way the default template in the SDK suggests to do it (in order to not bother the developer with finding the apparmor confined paths on the phone) and thus should probably also work with the thumbnailer.

As the thumbnailer is remote process and thus won't have access to the in-binary resources files, the QQmlImageProvider could perhaps extract them from the binary, provide them to the thumbnailer and delete the temporarily extracted original file again.