Icons black in gallery from krillin #45

Bug #1371509 reported by Alan Pope 🍺🐧🐱 🦄
32
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Critical
Tim Peeters

Bug Description

From image 45 onwards we have black icons on the main screen in gallery.
I flashed #44 and the icons are fine.
On #44 I updated ui toolkit like this:-

phablet@ubuntu-phablet:~$ sudo apt-get install qtdeclarative5-ubuntu-ui-toolkit-plugin ubuntu-ui-toolkit-theme
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  qtdeclarative5-ubuntu-ui-toolkit-plugin ubuntu-ui-toolkit-theme
2 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
Need to get 537 kB of archives.
After this operation, 13.3 kB of additional disk space will be used.
Get:1 http://derived.archive.canonical.com/ubuntu-rtm/ 14.09/main qtdeclarative5-ubuntu-ui-toolkit-plugin armhf 1.1.1239+14.10.20140908-0ubuntu1 [339 kB]
Get:2 http://derived.archive.canonical.com/ubuntu-rtm/ 14.09/main ubuntu-ui-toolkit-theme armhf 1.1.1239+14.10.20140908-0ubuntu1 [198 kB]
Fetched 537 kB in 1min 42s (5,224 B/s)
(Reading database ... 40146 files and directories currently installed.)
Preparing to unpack .../qtdeclarative5-ubuntu-ui-toolkit-plugin_1.1.1239+14.10.20140908-0ubuntu1_armhf.deb ...
Unpacking qtdeclarative5-ubuntu-ui-toolkit-plugin:armhf (1.1.1239+14.10.20140908-0ubuntu1) over (1.1.1227+14.10.20140903~rtm-0ubuntu1) ...
Preparing to unpack .../ubuntu-ui-toolkit-theme_1.1.1239+14.10.20140908-0ubuntu1_armhf.deb ...
Unpacking ubuntu-ui-toolkit-theme (1.1.1239+14.10.20140908-0ubuntu1) over (1.1.1227+14.10.20140903~rtm-0ubuntu1) ...
Setting up ubuntu-ui-toolkit-theme (1.1.1239+14.10.20140908-0ubuntu1) ...
Setting up qtdeclarative5-ubuntu-ui-toolkit-plugin:armhf (1.1.1239+14.10.20140908-0ubuntu1) ...

..and the icons broke again.

Seeing this kind of thing in the log..

file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Icon10.qml:34:5: QML QQuickImage: Failed to get image from provider: image://scaling/0.722222//usr/share/click/preinstalled/com.ubuntu.gallery/2.9.1.1056/rc/img/camera@18.png

Related branches

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Zsombor Egri (zsombi)
affects: ubuntu-ui-toolkit (Ubuntu) → ubuntu-ui-toolkit
Changed in ubuntu-ui-toolkit:
assignee: Zsombor Egri (zsombi) → nobody
Revision history for this message
Tim Peeters (tpeeters) wrote :
Changed in ubuntu-ui-toolkit:
assignee: nobody → Tim Peeters (tpeeters)
status: Confirmed → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :

Code to reproduce the issue:

import QtQuick 2.2
import Ubuntu.Components 1.1

Rectangle {
    color: "white"
    width: 400
    height: 400

    Icon {
        width: 50
        height: 50
        anchors.centerIn: parent

// name: "select" // works
// source: "select@18.png" // works
        source: "select.png" // breaks
    }
}

Revision history for this message
Tim Peeters (tpeeters) wrote :

code to reproduce the issue below. Save the attached select@18.png in the same directory as this program.

import QtQuick 2.2
import Ubuntu.Components 1.1

Rectangle {
    color: "white"
    width: 400
    height: 400

    Icon {
        width: 50
        height: 50
        anchors.centerIn: parent

// name: "select" // works
// source: "select@18.png" // works
        source: "select.png" // breaks
    }
}

Revision history for this message
Tim Peeters (tpeeters) wrote :

the example code I pasted above gives me this error:

file:///home/tim/dev/ubuntu-ui-toolkit/staging/modules/Ubuntu/Components/Icon10.qml:34:5: QML QQuickImage: Failed to get image from provider: image://scaling/0.444444//home/tim/select@18.png

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Shouldn't this be fixed in the gallery app by using name: "select" since that is the correct way of using an icon from the suru icon theme?

Revision history for this message
Tim Peeters (tpeeters) wrote :

Reverting the changes to only Icon10.qml in r1229 will fix the problem.

Revision history for this message
Tim Peeters (tpeeters) wrote :

so, it broke here:

=== modified file modules/Ubuntu/Components/Icon10.qml
--- modules/Ubuntu/Components/Icon10.qml 2014-08-21 13:59:24 +0000
+++ modules/Ubuntu/Components/Icon10.qml 2014-09-02 09:39:09 +0000
@@ -34,42 +34,16 @@
     Image {
         id: image
         objectName: "image"
- anchors.fill: parent
-
- /* Necessary so that icons are not loaded before a size is set. */
- source: ""
- sourceSize {
- width: 0
- height: 0
- }
-
- Component.onCompleted: update()
- onWidthChanged: update()
- onHeightChanged: update()
- Connections {
- target: icon
- ignoreUnknownSignals: true
- onNameChanged: image.update()
- onSourceChanged: image.update()
- }
-
- function update() {
- // only set sourceSize.width, sourceSize.height and source when
- // icon dimensions are valid, see bug #1349769.
- if (width > 0 && height > 0
- && (icon.name || (icon.hasOwnProperty("source") && icon.source))) {
- sourceSize.width = width;
- sourceSize.height = height;
- if (icon.hasOwnProperty("source")) {
- source = icon.source;
- } else {
- source = "image://theme/%1".arg(icon.name);
- }
- } else {
- source = "";
- sourceSize.width = 0;
- sourceSize.height = 0;
- }
+ anchors { top: parent.top; bottom: parent.bottom }
+ fillMode: Image.PreserveAspectFit;
+ sourceSize.height: height
+ source: {
+ if (icon.name)
+ return "image://theme/%1".arg(icon.name);
+ else if (icon.hasOwnProperty("source"))
+ return icon.source;
+ else
+ return "";
         }

         cache: true

Changed in ubuntu-ui-toolkit:
assignee: Tim Peeters (tpeeters) → Lars Uebernickel (larsu)
Revision history for this message
Tim Peeters (tpeeters) wrote :

Nekhelesh, it is indeed better if gallery-app updates to use the icon theme. Still some apps use icons not in the theme, and gallery-app worked with this code before so the bug needs to be fixed in UITK.

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
assignee: Lars Uebernickel (larsu) → Tim Peeters (tpeeters)
tags: added: lt-age-20140919 lt-blocker lt-category-visible lt-prio-high
Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Tim Peeters (tpeeters) wrote :

Confirmed that the bug is not present in krillin #72.

Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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