Index: trunk/psLib/src/image/psImage.c
===================================================================
--- trunk/psLib/src/image/psImage.c	(revision 1653)
+++ trunk/psLib/src/image/psImage.c	(revision 1818)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-28 01:18:28 $
+ *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,4 +25,6 @@
 #include "psError.h"
 #include "psImage.h"
+
+#include "psImageErrors.h"
 
 static void imageFree(psImage* image);
@@ -39,8 +41,8 @@
 
     if (area < 1) {
-        psError(__func__,
-                "Invalid value for number of rows or columns "
-                "(numRows=%d, numCols=%d).",
-                numRows, numCols);
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageAlloc",
+                   PS_ERR_BAD_PARAMETER_VALUE, true,
+                   PS_ERRORTEXT_psImage_AREA_NEGATIVE,
+                   numRows, numCols);
         return NULL;
     }
@@ -128,6 +130,8 @@
 
     if (old->type.dimen != PS_DIMEN_IMAGE) {
-        psError(__func__,
-                "Can not realloc image because input is not an image.");
+        psFree(old);
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRecycle",
+                   PS_ERR_BAD_PARAMETER_TYPE, true,
+                   PS_ERRORTEXT_psImage_NOT_AN_IMAGE);
         return NULL;
     }
@@ -214,19 +218,27 @@
 
     if (input == NULL) {
-        psError(__func__, "Image can not be NULL.");
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",
+                   PS_ERR_BAD_PARAMETER_NULL,true,
+                   PS_ERRORTEXT_psImage_IMAGE_NULL);
         return unexposedValue;
     }
-    #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \
-case PS_TYPE_##TYPE: \
-    switch (mode) { \
-    case PS_INTERPOLATE_FLAT: \
-        return p_psImagePixelInterpolateFLAT_##TYPE(input,x,y,unexposedValue); \
-        break; \
-    case PS_INTERPOLATE_BILINEAR: \
-        return p_psImagePixelInterpolateBILINEAR_##TYPE(input,x,y,unexposedValue); \
-        break; \
-    default: \
-        psError(__func__,"Unsupported interpolation mode (#%d)",mode); \
-    } \
+
+    #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE)                             \
+case PS_TYPE_##TYPE:                                                 \
+    switch (mode) {                                                  \
+    case PS_INTERPOLATE_FLAT:                                        \
+        return p_psImagePixelInterpolateFLAT_##TYPE(input, x, y,     \
+                unexposedValue);                                     \
+        break;                                                       \
+    case PS_INTERPOLATE_BILINEAR:                                    \
+        return p_psImagePixelInterpolateBILINEAR_##TYPE(input,x,y,   \
+                unexposedValue);                                     \
+        break;                                                       \
+    default:                                                         \
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",    \
+                   PS_ERR_BAD_PARAMETER_VALUE,true,                     \
+                   PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID,     \
+                   mode);                                               \
+    }                                                                    \
     break
 
@@ -245,5 +257,8 @@
         PSIMAGE_PIXEL_INTERPOLATE_CASE(C64);
     default:
-        psError(__func__, "Unsupported image datatype (%d)", input->type.type);
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",
+                   PS_ERR_BAD_PARAMETER_TYPE,true,
+                   PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED,
+                   input->type.type);
     }
 
