===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:
@@ -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 ) )
|
||||
|
||||
Reference in New Issue
Block a user