summaryrefslogtreecommitdiff
path: root/src/lua5
diff options
context:
space:
mode:
authorscuri <scuri>2010-05-26 18:29:48 +0000
committerscuri <scuri>2010-05-26 18:29:48 +0000
commitc196148fb2fd001a16434c46427d7651e5abb7f2 (patch)
tree652fa3f9e6e96a587169daba800dedd67d5a702a /src/lua5
parentd10c0cb34f483d5189ea70152babeabd0b89b546 (diff)
# Fixed: image:HasAlpha() method in Lua was returning a number instead of a boolean, so im.ImageCreateBased was adding an alpha channel to all new images.
Diffstat (limited to 'src/lua5')
-rw-r--r--src/lua5/imlua_image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua5/imlua_image.c b/src/lua5/imlua_image.c
index 9900e7d..a95007e 100644
--- a/src/lua5/imlua_image.c
+++ b/src/lua5/imlua_image.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_image.c,v 1.9 2010/01/17 18:18:12 scuri Exp $
+ * $Id: imlua_image.c,v 1.10 2010/05/26 18:29:49 scuri Exp $
*/
#include <string.h>
@@ -674,7 +674,7 @@ static int imluaImageColorSpace(lua_State *L)
static int imluaImageHasAlpha(lua_State *L)
{
imImage *im = imlua_checkimage(L, 1);
- lua_pushnumber(L, im->has_alpha);
+ lua_pushboolean(L, im->has_alpha);
return 1;
}
@@ -785,14 +785,14 @@ static int imluaImage_tostring (lua_State *L)
if (*image_p)
{
imImage *image = *image_p;
- lua_pushfstring(L, "imImage(%p) [width=%d,height=%d,color_space=%s,data_type=%s,depth=%d,has_alpha=%d]",
+ lua_pushfstring(L, "imImage(%p) [width=%d,height=%d,color_space=%s,data_type=%s,depth=%d,has_alpha=%s]",
image_p,
image->width,
image->height,
imColorModeSpaceName(image->color_space),
imDataTypeName(image->data_type),
image->depth,
- image->has_alpha
+ image->has_alpha? "yes": "no"
);
}
else