diff options
author | Ken Hughes <khughes@pacific.edu> | 2006-07-19 01:02:15 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2006-07-19 01:02:15 +0400 |
commit | e194ccce5e56ef0124107d40b3b2f5ad2625c816 (patch) | |
tree | ca3e02c05c8db720446525c89e80df124c998409 /source/blender/python/api2_2x/Image.c | |
parent | 5e58b2762cce14bf0ef293bddb35de0c6b6d677c (diff) |
===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.
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r-- | source/blender/python/api2_2x/Image.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index 6d056da1ecb..cad2b60521c 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -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 ) ) |