Index: /trunk/psLib/src/image/psImage.c
===================================================================
--- /trunk/psLib/src/image/psImage.c	(revision 1817)
+++ /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);
     }
 
Index: /trunk/psLib/src/image/psImageErrors.dat
===================================================================
--- /trunk/psLib/src/image/psImageErrors.dat	(revision 1817)
+++ /trunk/psLib/src/image/psImageErrors.dat	(revision 1818)
@@ -7,2 +7,8 @@
 #  N.B. in code, the ERRORNAME appears as PS_ERRORTEXT_ERRORNAME
 ####################################################################
+# psImage
+psImage_AREA_NEGATIVE                  Specified number of rows (%d) or columns (%d) is invalid.
+psImage_NOT_AN_IMAGE                   The input psImage must have a PS_DIMEN_IMAGE dimension type.
+psImage_IMAGE_NULL                     Can not operate on a NULL psImage.
+psImage_IMAGE_TYPE_UNSUPPORTED         Specified psImage type (%d) is not supported.
+psImage_INTERPOLATE_METHOD_INVALID     Specified interpolation method (%d) is not supported.
Index: /trunk/psLib/src/image/psImageErrors.h
===================================================================
--- /trunk/psLib/src/image/psImageErrors.h	(revision 1817)
+++ /trunk/psLib/src/image/psImageErrors.h	(revision 1818)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-11 00:43:54 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,4 +30,9 @@
 
 //~Start #define PS_ERRORTEXT_$1 "$2"
+#define PS_ERRORTEXT_psImage_AREA_NEGATIVE "Specified number of rows (%d) or columns (%d) is invalid."
+#define PS_ERRORTEXT_psImage_NOT_AN_IMAGE "The input psImage must have a PS_DIMEN_IMAGE dimension type."
+#define PS_ERRORTEXT_psImage_IMAGE_NULL "Can not operate on a NULL psImage."
+#define PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED "Specified psImage type (%d) is not supported."
+#define PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID "Specified interpolation method (%d) is not supported."
 //~End
 
Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 1817)
+++ /trunk/psLib/src/mathtypes/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);
     }
 
Index: /trunk/psLib/src/psErrorCodes.dat
===================================================================
--- /trunk/psLib/src/psErrorCodes.dat	(revision 1817)
+++ /trunk/psLib/src/psErrorCodes.dat	(revision 1818)
@@ -13,5 +13,5 @@
 MEMORY_DEREF_USAGE             dereferenced memory still used
 BAD_PARAMETER_VALUE            parameter is out-of-range
-BAD_PARAMETER_TYPE             parameter is of unsupported data-type
+BAD_PARAMETER_TYPE             parameter is of unsupported type
 BAD_PARAMETER_NULL             parameter is null
 BAD_PARAMETER_SIZE             size of parameter's data is outside of acceptable range.
Index: /trunk/psLib/src/sys/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.c	(revision 1817)
+++ /trunk/psLib/src/sys/psErrorCodes.c	(revision 1818)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-14 20:01:52 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,5 +38,5 @@
             {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"},
             {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"},
-            {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported data-type"},
+            {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported type"},
             {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"},
             {PS_ERR_BAD_PARAMETER_SIZE,"size of parameter's data is outside of acceptable range."},
Index: /trunk/psLib/src/sys/psErrorCodes.h
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.h	(revision 1817)
+++ /trunk/psLib/src/sys/psErrorCodes.h	(revision 1818)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-14 20:01:52 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -47,5 +47,5 @@
     PS_ERR_MEMORY_DEREF_USAGE,   ///< dereferenced memory still used
     PS_ERR_BAD_PARAMETER_VALUE,   ///< parameter is out-of-range
-    PS_ERR_BAD_PARAMETER_TYPE,   ///< parameter is of unsupported data-type
+    PS_ERR_BAD_PARAMETER_TYPE,   ///< parameter is of unsupported type
     PS_ERR_BAD_PARAMETER_NULL,   ///< parameter is null
     PS_ERR_BAD_PARAMETER_SIZE,   ///< size of parameter's data is outside of acceptable range.
Index: /trunk/psLib/src/sysUtils/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 1817)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 1818)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-14 20:01:52 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,5 +38,5 @@
             {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"},
             {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"},
-            {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported data-type"},
+            {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported type"},
             {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"},
             {PS_ERR_BAD_PARAMETER_SIZE,"size of parameter's data is outside of acceptable range."},
Index: /trunk/psLib/src/sysUtils/psErrorCodes.h
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 1817)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 1818)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-14 20:01:52 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-16 18:51:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -47,5 +47,5 @@
     PS_ERR_MEMORY_DEREF_USAGE,   ///< dereferenced memory still used
     PS_ERR_BAD_PARAMETER_VALUE,   ///< parameter is out-of-range
-    PS_ERR_BAD_PARAMETER_TYPE,   ///< parameter is of unsupported data-type
+    PS_ERR_BAD_PARAMETER_TYPE,   ///< parameter is of unsupported type
     PS_ERR_BAD_PARAMETER_NULL,   ///< parameter is null
     PS_ERR_BAD_PARAMETER_SIZE,   ///< size of parameter's data is outside of acceptable range.
