[gimp/goat-invasion: 496/526] app: hack badly to make gimp_channel_new_from_component() work
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 496/526] app: hack badly to make gimp_channel_new_from_component() work
- Date: Sun, 22 Apr 2012 13:40:58 +0000 (UTC)
commit 07ea3af2f491e546271700d0ca91a447948c0a4a
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 16 00:44:06 2012 +0200
app: hack badly to make gimp_channel_new_from_component() work
insert an intermediate copy to work around an unclear bug that will go
away once we use native GeglBuffers.
app/core/gimpchannel.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index 435d746..02b35dc 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -1704,9 +1704,27 @@ gimp_channel_new_from_component (GimpImage *image,
dest_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (channel));
- gegl_buffer_set_format (dest_buffer, format);
- gegl_buffer_copy (src_buffer, NULL, dest_buffer, NULL);
- gegl_buffer_set_format (dest_buffer, NULL);
+ if (TRUE)
+ {
+ GeglBuffer *temp;
+
+ temp = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
+ gimp_drawable_get_format (GIMP_DRAWABLE (channel)));
+
+ gegl_buffer_set_format (temp, format);
+ gegl_buffer_copy (src_buffer, NULL, temp, NULL);
+ gegl_buffer_set_format (temp, NULL);
+
+ gegl_buffer_copy (temp, NULL, dest_buffer, NULL);
+
+ g_object_unref (temp);
+ }
+ else
+ {
+ gegl_buffer_set_format (dest_buffer, format);
+ gegl_buffer_copy (src_buffer, NULL, dest_buffer, NULL);
+ gegl_buffer_set_format (dest_buffer, NULL);
+ }
return channel;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]