Bug 445502

Summary: KPL palettes fail to open or import
Product: [Applications] krita Reporter: Franck Rabeson <rabeson.franck>
Component: Resource ManagementAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: eoinoneill1991, griffinvalley, info, manuel.snudl.zeidler, tomtomtomreportingin
Priority: NOR Keywords: regression, release_blocker
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: KPL palette failing to load

Description Franck Rabeson 2021-11-14 20:36:33 UTC
Tested in: git d2f29d7

STEPS TO REPRODUCE
1. Try to use a previously imported KPL file or try to import a KPL file into either the Palette docker or the resource manager.

OBSERVED RESULT
If trying to open an existing palette file, the palette docker will let you select the palette but will not display its contents.
If trying to import a palette file, an error message appears: "Failed to import the resource"

EXPECTED RESULT
Importing a palette or loading an existing palette should work.

SOFTWARE/OS VERSIONS
Windows: 10 x64 v2104
Comment 1 tomtomtomreportingin 2021-11-14 23:25:11 UTC
I observed this yesterday in 5.0 beta 2 git e4dfc6 and it was also discussed in IRC, so confirming.
Comment 2 wolthera 2021-11-15 01:02:54 UTC
Yeah, had the same issue, it's caused by this commit: https://invent.kde.org/graphics/krita/-/commit/d58bbf3aaec478943b4edb782e5b0e5ff09804c3#note_339256
Comment 3 Eoin O'Neill 2021-11-17 03:26:39 UTC
As of master today, importing a KPL seems to work as expected.
Comment 4 David REVOY 2021-11-18 16:02:21 UTC
I confirm it is still a problem in 5.0branch. Tested in 5.0.0-beta2 (git fd399d7), a Krita Plus appimage build of two days ago. It wasn't the case with my previous Krita Plus appimage (start November?).  Sample of error in terminal:

> KoResourceSP KisResourceLocator::resource "/home/deevad/.local/share/krita/" "palettes" "selection-colors.0010.kpl" was not found

...while I confirm the file exists on my disk.

## Workaround:

I share my workaround because I saved over the last weeks a set of precise color saved for a project. I had to find them back to continue even if Krita 5.0beta couldn't load the file. For that, open the *.kpl files in ~/.local/share/krita/palettes/ ; extract it with a zip tool,   you'll have a colorset.xml files with the color saved (see under) where it is sort of possible to transform that into rgb percentages or convert with simple math to 0-255 values. You can then save that in *.gpl palette format and continue to work.

> <RGB space="sRGB built-in" g="0.592156887054443" r="0.666666686534882" b="0.541176497936249"/>
Comment 5 wolthera 2021-11-18 17:11:58 UTC
Ah, this has been fixed today by halla.
Comment 6 David REVOY 2021-11-18 22:23:15 UTC
I confirm it is fixed! I could quickly find a recent build 10min ago in Krita Plus ( https://binary-factory.kde.org/job/Krita_Stable_Appimage_Build/ )  and reload my palettes.  👍
Thanks @halla, also thanks @wolthera for the info.
Comment 7 M 2022-02-12 16:37:25 UTC
Created attachment 146631 [details]
KPL palette failing to load

This bug may need to be reopened. I am currently running into the issue with this sceneLinear KPL, I'll add it as an attachment here.
I'm using the newest Next Nightly (git e2673ac) on Windows and don't remember encountering this problem on the previous installed build I had from about 2 months ago.
Comment 8 wolthera 2022-02-12 16:45:23 UTC
(In reply to M from comment #7)
> Created attachment 146631 [details]
> KPL palette failing to load
> 
> This bug may need to be reopened. I am currently running into the issue with
> this sceneLinear KPL, I'll add it as an attachment here.
> I'm using the newest Next Nightly (git e2673ac) on Windows and don't
> remember encountering this problem on the previous installed build I had
> from about 2 months ago.

This is actually a different bug: someone changed the mimetype at some point, and I am LIVID about this. I will fix that as soon as possible.
Comment 9 M 2022-02-12 16:48:08 UTC
Ah okay, thanks for the quick info. You don't need an extra bug report I take it?
Comment 10 M 2022-03-09 22:02:45 UTC
I can confirm the bug I had is resolved now as well, thank you.