Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 1719)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 1840)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-28 01:18:28 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-21 22:30:19 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,4 +16,6 @@
 #include "psLogMsg.h"
 #include "psError.h"
+
+#include "psImageErrors.h"
 
 static void freeKernel(psKernel* ptr);
@@ -76,5 +78,5 @@
 }
 
-psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts)
+psKernel* psKernelGenerate(const psVector* xShifts, const psVector* yShifts)
 {
     int x = 0;
@@ -91,10 +93,20 @@
     // got non-NULL vectors?
     if (xShifts == NULL || yShifts == NULL) {
-        psError(__func__,"Shift vectors can not be NULL.");
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
+                   PS_ERR_BAD_PARAMETER_NULL, true,
+                   PS_ERRORTEXT_psImageConvolve_SHIFT_NULL);
         return NULL;
     }
 
+    // types match?
     if (xShifts->type.type != yShifts->type.type) {
-        psError(__func__,"Shift vectors can not be different data types.");
+        char* typeXStr;
+        char* typeYStr;
+        PS_TYPE_NAME(typeXStr,xShifts->type.type);
+        PS_TYPE_NAME(typeYStr,yShifts->type.type);
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
+                   PS_ERR_BAD_PARAMETER_TYPE, true,
+                   PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH,
+                   typeXStr, typeYStr);
         return NULL;
     }
@@ -158,6 +170,13 @@
         KERNEL_GENERATE_CASE(C32);
         KERNEL_GENERATE_CASE(C64);
-    default:
-        psError(__func__,"Shift vector datatype not supported.");
+
+    default: {
+            char* typeStr;
+            PS_TYPE_NAME(typeStr,xShifts->type.type);
+            psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
+                       PS_ERR_BAD_PARAMETER_TYPE, true,
+                       PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED,
+                       typeStr);
+        }
     }
 
Index: trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- trunk/psLib/src/imageops/psImageStats.c	(revision 1719)
+++ trunk/psLib/src/imageops/psImageStats.c	(revision 1840)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-09-08 06:02:47 $
+*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-09-21 22:30:19 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,4 +32,6 @@
 #include "psImageStats.h"
 
+#include "psImageErrors.h"
+
 /// This routine must determine the various statistics for the image.
 
@@ -43,15 +45,21 @@
 
     if (stats == NULL) {
-        psError(__func__, "The input psStats struct can not be NULL.");
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
+                   PS_ERR_BAD_PARAMETER_NULL, true,
+                   PS_ERRORTEXT_psImage_STAT_NULL);
         return NULL;
     }
 
     if (in == NULL) {
-        psError(__func__, "The input image can not be NULL.");
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
+                   PS_ERR_BAD_PARAMETER_NULL, true,
+                   PS_ERRORTEXT_psImage_IMAGE_NULL);
         return NULL;
     }
 
     if (stats->options == 0) {
-        psError(__func__, "No statistic option/operation was specified.");
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
+                   PS_ERR_BAD_PARAMETER_VALUE, true,
+                   PS_ERRORTEXT_psImage_NO_STAT_OPTIONS);
         return stats;
     }
@@ -62,13 +70,14 @@
     junkData->nalloc = in->numRows * in->numCols;
     junkData->n = junkData->nalloc;
-    junkData->data.V = in->data.V[0];      // since
-    // psImage
-    // data
-    // is
-    // contiguous...
+    junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
 
     if (mask != NULL) {
         if (mask->type.type != PS_TYPE_MASK) {
-            psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type);
+            char* typeStr;
+            PS_TYPE_NAME(typeStr,mask->type.type);
+            psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
+                       PS_ERR_BAD_PARAMETER_TYPE, true,
+                       PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
+                       typeStr, PS_TYPE_MASK_NAME);
             psFree(junkData);
             return NULL;
@@ -109,18 +118,19 @@
     junkData->nalloc = in->numRows * in->numCols;
     junkData->n = junkData->nalloc;
-    junkData->data.V = in->data.V[0];      // since
-    // psImage
-    // data
-    // is
-    // contiguous...
+    junkData->data.V = in->data.V[0];  // since psImage data is contiguous...
 
     if (mask != NULL) {
         if (mask->type.type != PS_TYPE_MASK) {
-            psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type);
+            char* typeStr;
+            PS_TYPE_NAME(typeStr,mask->type.type);
+            psErrorMsg(PS_ERRORNAME_DOMAIN "psImageHistogram",
+                       PS_ERR_BAD_PARAMETER_TYPE, true,
+                       PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
+                       typeStr, PS_TYPE_MASK_NAME);
+            psFree(out);
             psFree(junkData);
             return NULL;
         }
-        // stuff the mask data into a psVector
-        // struct.
+        // stuff the mask data into a psVector struct.
         junkMask = psAlloc(sizeof(psVector));
         junkMask->type = mask->type;
