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.
This commit is contained in:
Michael Natterer 2015-11-25 00:00:44 +01:00
parent a69b68de40
commit b3239f58df
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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);