mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
libgimpcolor: work around babl_format_has_alpha() bug with some formats.
With "HSVA" and a few others, the function was not returning the right value (it could not see it was encoding alpha channel. I had fixed it on babl directly with commit a28309c yet I had forgotten to push it! Let's just add some #ifdef and a comment.
This commit is contained in:
parent
f8ddc94a8b
commit
e6e7fa8f8d
1 changed files with 12 additions and 0 deletions
|
@ -334,6 +334,18 @@ gimp_babl_format_get_with_alpha (const Babl *format)
|
||||||
return format;
|
return format;
|
||||||
|
|
||||||
model = babl_get_name (babl_format_get_model (format));
|
model = babl_get_name (babl_format_get_model (format));
|
||||||
|
|
||||||
|
/* Special-cased because babl_format_has_alpha() doesn't see that these
|
||||||
|
* formats encode alpha. This has been fixed with commit a28309c.
|
||||||
|
* TODO: remove this test when babl 0.1.110 is released and we depend on it.
|
||||||
|
*/
|
||||||
|
#if BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION <= 108
|
||||||
|
if (g_strcmp0 (model, "HCYA") == 0 ||
|
||||||
|
g_strcmp0 (model, "HSLA") == 0 ||
|
||||||
|
g_strcmp0 (model, "HSVA") == 0)
|
||||||
|
return format;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Assuming we use Babl formats with same type for all components. */
|
/* Assuming we use Babl formats with same type for all components. */
|
||||||
type = babl_get_name (babl_format_get_type (format, 0));
|
type = babl_get_name (babl_format_get_type (format, 0));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue