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.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to thumbnailer in Ubuntu.
https://bugs.launchpad.net/bugs/1550706

Title:
  Thumbnails not working with qrc

Status in Client Developer Experience:
  New
Status in thumbnailer package in Ubuntu:
  New

Bug description:
  The thumbnailer works only if I load images from the file system, not
  from a resource file:

      Image {
          id: backgroundImage
          anchors.fill: parent
          sourceSize: Qt.size(parent.width, parent.height)
          source: "image://thumbnailer/qrc:///images/menu-background.jpg"
      }

  The default sdk template uses qrc as template.

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-developer-experience/+bug/1550706/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to