[gimp] Bug 601891 - gimp_image_get_selection returns None
- From: Sven Neumann <neo src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Bug 601891 - gimp_image_get_selection returns None
- Date: Sat, 14 Nov 2009 15:52:06 +0000 (UTC)
commit 474b5fdff3b0bb39f252e67f7ead6357e6f69007
Author: Sven Neumann <sven gimp org>
Date: Sat Nov 14 16:50:42 2009 +0100
Bug 601891 - gimp_image_get_selection returns None
The code used to make the assumption that the selection mask was
a layer. Actually it is a channel and changing the code accordingly
fixes the reported problem.
plug-ins/pygimp/pygimp-pdb.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/pygimp/pygimp-pdb.c b/plug-ins/pygimp/pygimp-pdb.c
index 83a62fd..865541b 100644
--- a/plug-ins/pygimp/pygimp-pdb.c
+++ b/plug-ins/pygimp/pygimp-pdb.c
@@ -284,7 +284,7 @@ pygimp_param_to_tuple(int nparams, const GimpParam *params)
value = pygimp_drawable_new(NULL, params[i].data.d_drawable);
break;
case GIMP_PDB_SELECTION:
- value = pygimp_layer_new(params[i].data.d_selection);
+ value = pygimp_channel_new(params[i].data.d_selection);
break;
case GIMP_PDB_COLORARRAY:
if (params[i].data.d_colorarray == NULL) {
@@ -538,8 +538,12 @@ pygimp_param_from_tuple(PyObject *args, const GimpParamDef *ptype, int nparams)
ret[i].data.d_channel = ((PyGimpDrawable *)item)->ID;
break;
case GIMP_PDB_SELECTION:
- check(!pygimp_layer_check(item));
- ret[i].data.d_selection = ((PyGimpLayer *)item)->ID;
+ if (item == Py_None) {
+ ret[i].data.d_channel = -1;
+ break;
+ }
+ check(!pygimp_channel_check(item));
+ ret[i].data.d_selection = ((PyGimpChannel *)item)->ID;
break;
case GIMP_PDB_COLORARRAY:
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]