[gimp] app: use gimp_image_get_component_format() instead of hardcoding "A u8"
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use gimp_image_get_component_format() instead of hardcoding "A u8"
- Date: Wed, 2 May 2012 16:40:57 +0000 (UTC)
commit 7c271f15fcf3dcb5a5da02cf8eb39e1756d8d9d0
Author: Michael Natterer <mitch gimp org>
Date: Sun Apr 22 15:50:02 2012 +0200
app: use gimp_image_get_component_format() instead of hardcoding "A u8"
to extract a drawable's alpha channel into a layer mask.
app/core/gimplayer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 29c350b..f4ffefa 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1292,10 +1292,14 @@ gimp_layer_create_mask (const GimpLayer *layer,
if (gimp_drawable_has_alpha (drawable))
{
GeglBuffer *dest_buffer;
+ const Babl *component_format;
dest_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
- gegl_buffer_set_format (dest_buffer, babl_format ("A u8"));
+ component_format =
+ gimp_image_get_component_format (image, GIMP_ALPHA_CHANNEL);
+
+ gegl_buffer_set_format (dest_buffer, component_format);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
gegl_buffer_set_format (dest_buffer, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]