From 01288d7ae1be4abc83817cd5d12fb7c5f72beda0 Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 16 May 2004 18:54:10 +0000 Subject: [PATCH] fixed ImageShape image size lookup. --- lib/python/tags.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/python/tags.c b/lib/python/tags.c index e642125..a9e8181 100644 --- a/lib/python/tags.c +++ b/lib/python/tags.c @@ -347,6 +347,18 @@ static void image_dealloc(tag_internals_t*self) free(pi->rgba);pi->rgba = 0; } } +static int imagetag_getWidth(PyObject* self) +{ + tag_internals_t*itag = tag_getinternals(self); + image_internal_t*pi = (image_internal_t*)itag->data; + return pi->width; +} +static int imagetag_getHeight(PyObject* self) +{ + tag_internals_t*itag = tag_getinternals(self); + image_internal_t*pi = (image_internal_t*)itag->data; + return pi->height; +} static PyObject* f_DefineImage(PyObject* self, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"image"}; @@ -420,8 +432,8 @@ static PyObject* f_DefineImageShape(PyObject* self, PyObject* args, PyObject* kw shape_internal_t*ti = (shape_internal_t*)itag->data; ti->shape = 0; /*HACK*/ - int width = image_getWidth(image); - int height = image_getHeight(image); + int width = imagetag_getWidth(image); + int height = imagetag_getHeight(image); int id = tagmap_add(itag->tagmap, image); itag->tag= swf_InsertTag(0, ST_DEFINESHAPE3); swf_SetU16(itag->tag, 0); -- 1.7.10.4