diff options
-rw-r--r-- | include/im_image.h | 2 | ||||
-rw-r--r-- | src/im_image.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/im_image.h b/include/im_image.h index f0cc4f3..b5e8628 100644 --- a/include/im_image.h +++ b/include/im_image.h @@ -151,7 +151,7 @@ void* imImageGetOpenGLData(imImage* image, int *format); /** Changes an extended attribute. \n * The data will be internally duplicated. \n - * If data is NULL the attribute is removed. \n + * If data is NULL and count==0 the attribute is removed. \n * If count is -1 and data_type is IM_BYTE then data is zero terminated. * See also \ref imDataType. * diff --git a/src/im_image.cpp b/src/im_image.cpp index 80553a7..7bc20de 100644 --- a/src/im_image.cpp +++ b/src/im_image.cpp @@ -2,7 +2,7 @@ * \brief Image Manipulation * * See Copyright Notice in im_lib.h - * $Id: im_image.cpp,v 1.2 2009/08/12 04:09:16 scuri Exp $ + * $Id: im_image.cpp,v 1.3 2009/08/13 02:27:10 scuri Exp $ */ #include <stdlib.h> @@ -465,8 +465,10 @@ void imImageSetAttribute(imImage* image, const char* attrib, int data_type, int attrib_table->Set(attrib, data_type, count, data); } - else + else if (count == 0) attrib_table->UnSet(attrib); + else + attrib_table->Set(attrib, data_type, count, NULL); } const void* imImageGetAttribute(const imImage* image, const char* attrib, int *data_type, int *count) |