Commit b3239f58 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

Bug 758597 - gimp-drawable-get-pixel fails, assertion error in BABL

The code that actually allocates the returned pixel got lost when
porting this to GEGL.
parent a69b68de
......@@ -624,6 +624,9 @@ drawable_get_pixel_invoker (GimpProcedure *procedure,
if (x_coord < gimp_item_get_width (GIMP_ITEM (drawable)) &&
y_coord < gimp_item_get_height (GIMP_ITEM (drawable)))
{
num_channels = babl_format_get_bytes_per_pixel (format);
pixel = g_new0 (guint8, num_channels);
gegl_buffer_sample (gimp_drawable_get_buffer (drawable),
x_coord, y_coord, NULL, pixel, format,
GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
......
......@@ -635,6 +635,9 @@ HELP
if (x_coord < gimp_item_get_width (GIMP_ITEM (drawable)) &&
y_coord < gimp_item_get_height (GIMP_ITEM (drawable)))
{
num_channels = babl_format_get_bytes_per_pixel (format);
pixel = g_new0 (guint8, num_channels);
gegl_buffer_sample (gimp_drawable_get_buffer (drawable),
x_coord, y_coord, NULL, pixel, format,
GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment