From 22eee5011ab2699a3267bde4a7b4430d8460314c Mon Sep 17 00:00:00 2001
From: scuri <scuri>
Date: Thu, 13 Aug 2009 02:27:09 +0000
Subject: *** empty log message ***

---
 include/im_image.h | 2 +-
 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)
-- 
cgit v1.2.3