Summary: | Palettes made in Gpick or Mypaint appear half-full or empty in Krita. | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | wolthera <griffinvalley> |
Component: | Color Selectors | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ghevan, halla |
Priority: | NOR | Keywords: | junior-jobs |
Version: | 2.6.1 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/calligra/c0f9671483df748d9625a496ad07b29283ea02c1 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
A pallete that is only half-read by Krita
The palette file before I modified it in Krita. A pallete file that is considered empty by Krita. palette file modified in GIMP to test pallete swatches loading. Pallete file that is fixed by hand. |
Description
wolthera
2013-04-14 15:13:20 UTC
Created attachment 78895 [details]
A pallete that is only half-read by Krita
Created attachment 78896 [details]
The palette file before I modified it in Krita.
Created attachment 78897 [details]
A pallete file that is considered empty by Krita.
To clarify, the second palette file is half-read by Krita, the first is when I tried modifying it in Krita to see what would happen... Created attachment 78949 [details]
palette file modified in GIMP to test pallete swatches loading.
Hello, thank you for your report.
I loaded your test files and as you stated, some palettes load and some doesn't, but It seems it's not entirely a Krita bug. Here is my testing
I loaded your files in GIMP but b doing that I've got all sorts of mistakes from Blue-Yellow_backup.gpl and Candy.gpl however after reporting the errors and declaring that no colors are available it loads the color swatches just fine.
After loading the Candy.gpl swatches to GIMP I saved the palette. (This saves the gpl file inside gimp preferences directory, not in the original import file)
Loading the file modified by GIMP to Krita works perfectly fine.
The files look alike but as you will notice the indentation changes a lot from one file to the other. I think that makes Gimp trow so many errors and Krita ignore the swatches. Perhaps Krita should send some errors as GIMP does?
I attach the Candy.gpl modified in GIMP
however, there seems to be a limit on the columns in Krita. Palette's Column in Mypaint and Gimp can be set to greater than 16, like 18 or 24. Krita columns are limited to 16 columns. I wonder if this is intended. I don't think Krita can understand columns at all, actually. At the very least 2.6.1 doesn't. Anyway, I figured out the problem: It's a mypaint/gpick bug actually. Basically, Gimp and Krita consider the values of r, g and b to go from 0 to 255. Mypaint and Gpick think they go from 1 to 256. Resulting in out-of-range colours when exporting these to Gimp and Krita. Gimp happily throws errors at you when confronted with out-of-bound colour-ranges. Krita however, merrily loads the colours until it finds a colour out-of-bounds, and then stops loading all together without giving the slightest hint of what is going on. Decide for yourselves if this lack of warning can be considered a bug, in the meantime, I'm going to report a bug at the Mypaint and Gpick bugtrackers, and link them to here. I'll attach the fixed palette, you'll notice this one doesn't start with green swatches ;) Created attachment 78986 [details]
Pallete file that is fixed by hand.
Thanks so much for the investigation! It should be pretty easy to make Krita more forgiving, marking this as a junior job. Lovely code from when I had about two years of C++ experience... } else if (s.startsWith("GIMP Palette")) { // XXX: No checks for wrong input yet! and I didn't lie. Git commit c0f9671483df748d9625a496ad07b29283ea02c1 by Sven Langkamp. Committed on 02/07/2013 at 14:40. Pushed by langkamp into branch 'master'. Make loading of colors in colorsets more tolerant to bogus values M +7 -5 libs/pigment/resources/KoColorSet.cpp M +2 -0 libs/pigment/resources/KoColorSet.h http://commits.kde.org/calligra/c0f9671483df748d9625a496ad07b29283ea02c1 |