plug-ins: Fix color format for Smooth Palette...

...when drawable has alpha channel.
We always created GeglSamplers in RGB format,
but used the original drawable's format to create a
GeglBuffer. If the original drawable had an alpha
channel, this caused "glitchy" results since not
enough data would be copied into the new buffer.
This patch resolves the issue by making the format
match the original drawable's number of channels.

Resolves Issue #12362.
This commit is contained in:
Alx Sa 2024-11-14 11:33:14 +00:00
parent c0395d1d4b
commit 56d207e98d

View file

@ -282,7 +282,8 @@ smooth_palette (GimpProcedureConfig *config,
gfloat *pal;
GRand *gr;
const Babl *format = babl_format ("RGB float");
const Babl *format = gimp_drawable_has_alpha (drawable) ?
babl_format ("RGBA float") : babl_format ("RGB float");
g_object_get (config,
"width", &config_width,