===Python API===

Bugfix: using Image.GetCurrent() and image.save() on the "Render Result"
image could result in a segfault since image->ibuf was NULL.  This change
forces ibuf to be created if necessary.

NOTE: the Image API needs additional methods/attributes for image.save() to
really do anything useful.  The image type, quality, etc., don't seem to be
gettable/settable so the resulting image file may not be in the format the
user would like.
This commit is contained in:
Ken Hughes
2006-07-18 21:02:15 +00:00
parent 5e58b2762c
commit e194ccce5e

View File

@@ -320,11 +320,10 @@ static PyObject *M_Image_GetCurrent( PyObject * self )
if (!G.sima || !G.sima->image) {
Py_RETURN_NONE;
}
what_image( G.sima ); /* make sure image data exists */
return Image_CreatePyObject( G.sima->image );
}
/*****************************************************************************/
/* Function: M_Image_Load */
/* Python equivalent: Blender.Image.Load */
@@ -696,8 +695,6 @@ static PyObject *Image_pack( BPy_Image * self )
static PyObject *Image_save( BPy_Image * self )
{
Py_INCREF( Py_None );
if( !IMB_saveiff
( self->image->ibuf, self->image->name,
self->image->ibuf->flags ) )