Bug 395894 - Custom template icons are broken
Summary: Custom template icons are broken
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Resource Management (show other bugs)
Version: 4.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2018-06-26 13:57 UTC by Kapyia
Modified: 2020-10-21 12:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Selecting a custom Template shows no picture/icon or preview. (17.10 KB, image/png)
2018-06-26 13:57 UTC, Kapyia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kapyia 2018-06-26 13:57:22 UTC
Created attachment 113581 [details]
Selecting a custom Template shows no picture/icon or preview.

Pictures/icons for custom templates when creating new projects appears to be broken. The 'preview' icons don't show up, and choosing a custom picture only results in a message stating "Could not load picture."

The problem is only with the pictures of custom templates; the template files opens without any errors, and the default template icons are working properly.

Sidenote: allowing the users to add a brief description of the templates they create would be nice, I think.
Comment 1 Halla Rempt 2018-06-30 09:38:07 UTC
I'm sorry, but I cannot reproduce that problem :-( I'm rewriting the resource system in any case, and I'll also make templates much simpler, with everything self-contained in one .kra file.
Comment 2 Kapyia 2018-07-02 21:29:21 UTC
Ah, too bad. Maybe it's on my end then. I'll report back when the new resource system is out and I can test with that!
Comment 3 Tiar 2018-10-02 18:01:05 UTC
Krita version: 4.2.0-pre-alpha (git 5120b70)


1) I can confirm. After a little of investigation I can say that it's because custom/user templates are saved differently than the standard ones. In standard ones, there is no .icon folder with .png picture. The line about icon in .desktop file says (for example):

    Icon=template_animation

And in custom ones it says:

    Icon=Icon=.icon/filename.png

If we change the line in .desktop file for the custom template to the template_animation, the template have that icon. Moreover, the custom group of templates has the icon of the first template (that is, if the first template has no working icon, the group has no working icon as well; if the first template has the working icon, that icon will be used; no matter what icons the other templates have).

2) "Could not load picture." bug appears on my PC, too.
Comment 4 Halla Rempt 2020-10-21 12:16:40 UTC
Git commit 7e450cc70f80e1144301059f8d66f45115843940 by Boudewijn Rempt, on behalf of Evan Thompson.
Committed on 21/10/2020 at 12:16.
Pushed by rempt into branch 'master'.

Fix user template icons not displaying on Windows

Absolute Windows paths were not being checked for, causing
user template icons to not load. QFile::exists is a simple
cross platform method of checking for an absolute path.

This also fixes custom icons for user templates.

M  +1    -1    libs/ui/KisTemplate.cpp

https://invent.kde.org/graphics/krita/commit/7e450cc70f80e1144301059f8d66f45115843940
Comment 5 Halla Rempt 2020-10-21 12:17:12 UTC
Git commit b758c958129615ad350271f054552fd9d3de8eec by Boudewijn Rempt, on behalf of Evan Thompson.
Committed on 21/10/2020 at 12:17.
Pushed by rempt into branch 'krita/4.3'.

Fix user template icons not displaying on Windows

Absolute Windows paths were not being checked for, causing
user template icons to not load. QFile::exists is a simple
cross platform method of checking for an absolute path.

This also fixes custom icons for user templates.
(cherry picked from commit 7e450cc70f80e1144301059f8d66f45115843940)

M  +1    -1    libs/ui/KisTemplate.cpp

https://invent.kde.org/graphics/krita/commit/b758c958129615ad350271f054552fd9d3de8eec