[gimp] app: don't assume that a GimpColorManaged is always also a GimpPickable
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: don't assume that a GimpColorManaged is always also a GimpPickable
- Date: Fri, 15 Apr 2016 17:15:26 +0000 (UTC)
commit f71894077242a0bcc420b66728752cd8d6feecae
Author: Michael Natterer <mitch gimp org>
Date: Fri Apr 15 18:14:08 2016 +0100
app: don't assume that a GimpColorManaged is always also a GimpPickable
Instead, get the color config via GimpViewRenderer's context.
app/widgets/gimpviewrenderer.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/app/widgets/gimpviewrenderer.c b/app/widgets/gimpviewrenderer.c
index 5030111..009e917 100644
--- a/app/widgets/gimpviewrenderer.c
+++ b/app/widgets/gimpviewrenderer.c
@@ -43,7 +43,6 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpmarshal.h"
-#include "core/gimppickable.h"
#include "core/gimptempbuf.h"
#include "core/gimpviewable.h"
@@ -1260,16 +1259,21 @@ gimp_view_renderer_transform_create (GimpViewRenderer *renderer,
{
if (GIMP_IS_COLOR_MANAGED (renderer->viewable))
{
- GimpColorManaged *managed = GIMP_COLOR_MANAGED (renderer->viewable);
- GimpPickable *pickable = GIMP_PICKABLE (renderer->viewable);
+ GimpColorManaged *managed = GIMP_COLOR_MANAGED (renderer->viewable);
GimpColorProfile *profile;
+ if (G_UNLIKELY (renderer->context == NULL))
+ {
+ g_warning ("%s: renderer->context is NULL", G_STRFUNC);
+ return;
+ }
+
profile = gimp_color_managed_get_color_profile (managed);
if (profile)
{
- GimpImage *image = gimp_pickable_get_image (pickable);
- GimpColorConfig *config = image->gimp->config->color_management;
+ GimpContext *context = renderer->context;
+ GimpColorConfig *config = context->gimp->config->color_management;
renderer->profile_src_format = gegl_buffer_get_format (src_buffer);
renderer->profile_dest_format = gegl_buffer_get_format (dest_buffer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]