Commit f05ea433 authored by Sven Neumann's avatar Sven Neumann

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.
(cherry picked from commit 474b5fdf)
parent df2b0aca
......@@ -285,7 +285,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) {
......@@ -539,8 +539,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:
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment