Index: trunk/psLib/src/image/psImageManip.c
===================================================================
--- trunk/psLib/src/image/psImageManip.c	(revision 1292)
+++ trunk/psLib/src/image/psImageManip.c	(revision 1319)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-24 02:00:21 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-29 01:20:10 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -276,4 +276,5 @@
 
     if (input == NULL) {
+        psError(__func__,"Can not perform clip on NULL image");
         return 0;
     }
@@ -301,5 +302,6 @@
                 psError(__func__, "Specified vmin (%g%+gi) is outside of image's " \
                         typename " pixel range", \
-                        realfcn(vmin),imagfcn(vmin)); \
+                        creal(vmin),cimag(vmin)); \
+                break; \
             } \
             if (realfcn(vmax) > PS_MAX_##type || imagfcn(vmax) > PS_MAX_##type || \
@@ -307,5 +309,6 @@
                 psError(__func__, "Specified vmax (%g%+gi) is outside of image's " \
                         typename " pixel range", \
-                        realfcn(vmax),imagfcn(vmax)); \
+                        creal(vmax),cimag(vmax)); \
+                break; \
             } \
             for (unsigned int row = 0;row<numRows;row++) { \
@@ -313,8 +316,8 @@
                 for (unsigned int col = 0; col < numCols; col++) { \
                     if ( (realfcn(inputRow[col]) > realMax) || (imagfcn(inputRow[col]) > imagMax) ) { \
+                        inputRow[col] = (ps##type)vmax; \
+                        numClipped++; \
+                    } else if ( (realfcn(inputRow[col]) < realMin) || (imagfcn(inputRow[col]) < imagMin) ){ \
                         inputRow[col] = (ps##type)vmin; \
-                        numClipped++; \
-                    } else if ( (realfcn(inputRow[col]) < realMin) || (imagfcn(inputRow[col]) < imagMax) ){ \
-                        inputRow[col] = (ps##type)vmax; \
                         numClipped++; \
                     } \
