[Image-SIG] return Imaging to Python
Huiying Shen
hshen@ski.org
Tue, 22 Jun 1999 18:08:38 -0700
Hi,
I am writing an C-extension which takes Imaging as input from Python
interpreter as well as return Imaging back to Python environment. I am
having problem with the latter. VC++5.0 says: The instruction at
0x1e1388a9" referenced at "0x00000048". The memory could not be read.
I used the identical code to generate a Python list in C and return it
to python just fine.
Any suggestion is appreciated.
Huiying
Here is the code:
import skImagingc
sk = skImagingc.skImTst2() #works ok
dir(sk) #crashs python
static PyObject *_wrap_skImTst2(PyObject *self, PyObject *args) {
PyObject * _resultobj;
self = self;
if(!PyArg_ParseTuple(args,":skImTst2"))
return NULL;
{
_resultobj = (PyObject*)skImTst2();
Py_INCREF(_resultobj);
}
return _resultobj;
}
Imaging skImTst2()
{
Imaging im = ImagingNew("RGB",10,15);
return im;
}
--
Huiying Shen
Programmer/System Administrator
Smith-Kettlewell Eye Research Institute
2318 Fillmore Street
San Francisco, CA 94115
e-mail: hshen@ski.org