Image fails to load if only sourceSize.height or width is specified

Bug #1314594 reported by Ugo Riboni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Confirmed
Low
Unassigned
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

By using the example at the bottom of this description, an error is reported on the console:
QML QQuickImage: Failed to get image from provider: image://scaling/0.444444//home/nerochiaro/projects/phone/camera/camera-app-desktop-camera/assets/zoom_plus@18.png
(path is obviously specific to that test run, but the image mentioned in the error actually exists on disk)

Either removing sourceSize.height or adding sourceSize.width makes the error disappear and the image loads correctly.

So it seems that the two sourceSize properties need to be either both set or both unset, but it can't be just one.

import QtQuick 2.0
import Ubuntu.Components 0.1

Item {
 width: 600
 height: 600

    Image {
        anchors.centerIn: parent
        source: "assets/zoom_plus.png"
        sourceSize.height: units.gu(2) // if I remove this it all works just fine
    }
}

Revision history for this message
Florian Boucault (fboucault) wrote :

Although this is a valid bug using sourceSize with assets should not be done as it will result in unnecessary scaling.

Changed in ubuntu-ui-toolkit:
importance: Undecided → Low
status: New → Confirmed
Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.