Index: trunk/psLib/src/image/psImageManip.c
===================================================================
--- trunk/psLib/src/image/psImageManip.c	(revision 1941)
+++ trunk/psLib/src/image/psImageManip.c	(revision 2105)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-02 02:08:00 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-14 01:22:59 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -569,4 +569,23 @@
         return NULL;
     }
+
+    if (scale < 1) {
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample",
+                   PS_ERR_BAD_PARAMETER_VALUE, true,
+                   PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE,
+                   scale);
+        psFree(out);
+        return NULL;
+    }
+
+    if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageResample",
+                   PS_ERR_BAD_PARAMETER_VALUE, true,
+                   PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
+                   mode);
+        psFree(out);
+        return NULL;
+    }
+
     // create an output image of the same size
     // and type
@@ -582,5 +601,5 @@
             float inRow = (float)row * invScale; \
             for (int col=0;col<outCols;col++) { \
-                rowData[col] = psImagePixelInterpolate(in,inRow,(float)col*invScale,NULL,0,0,mode); \
+                rowData[col] = psImagePixelInterpolate(in,(float)col*invScale,inRow,NULL,0,0,mode); \
             } \
         }  \
