Index: trunk/psLib/src/image/psImageExtraction.c
===================================================================
--- trunk/psLib/src/image/psImageExtraction.c	(revision 1924)
+++ trunk/psLib/src/image/psImageExtraction.c	(revision 1929)
@@ -9,6 +9,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-29 01:10:27 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-29 20:17:58 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,6 +65,6 @@
                    PS_ERR_BAD_PARAMETER_VALUE, true,
                    PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
-                   col0, col1, row0, row1,
-                   image->numCols, image->numRows);
+                   col0, col1-1, row0, row1-1,
+                   image->numCols-1, image->numRows-1);
         return NULL;
     }
@@ -166,5 +166,14 @@
         return NULL;
     }
-    return imageSubset(NULL,image,col0,row0,col1,row1);
+
+    if (col0 > col1 || row0 > row1) {
+        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubsection",
+                   PS_ERR_BAD_PARAMETER_VALUE, true,
+                   PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED,
+                   col0,col1,row0,row1);
+        return NULL;
+    }
+
+    return imageSubset(NULL,image,col0,row0,col1+1,row1+1);
 }
 
