Index: trunk/psLib/src/image/psImage.c
===================================================================
--- trunk/psLib/src/image/psImage.c	(revision 4493)
+++ trunk/psLib/src/image/psImage.c	(revision 4526)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-07 02:17:53 $
+ *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-09 01:24:30 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -48,6 +48,6 @@
 }
 
-psImage* psImageAlloc(psU32 numCols,
-                      psU32 numRows,
+psImage* psImageAlloc(int numCols,
+                      int numRows,
                       psElemType type)
 {
@@ -149,6 +149,6 @@
 
 psImage* psImageRecycle(psImage* old,
-                        psU32 numCols,
-                        psU32 numRows,
+                        int numCols,
+                        int numRows,
                         const psElemType type)
 {
Index: trunk/psLib/src/image/psImage.h
===================================================================
--- trunk/psLib/src/image/psImage.h	(revision 4493)
+++ trunk/psLib/src/image/psImage.h	(revision 4526)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-07 02:17:53 $
+ *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-09 01:24:30 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -51,9 +51,9 @@
 typedef struct psImage
 {
-    const psMathType type;                 ///< Image data type and dimension.
-    const psU32 numCols;               ///< Number of columns in image
-    const psU32 numRows;               ///< Number of rows in image.
-    const psS32 col0;                  ///< Column position relative to parent.
-    const psS32 row0;                  ///< Row position relative to parent.
+    const psMathType type;             ///< Image data type and dimension.
+    const int numCols;                 ///< Number of columns in image
+    const int numRows;                 ///< Number of rows in image.
+    const int col0;                    ///< Column position relative to parent.
+    const int row0;                    ///< Row position relative to parent.
 
     union {
@@ -77,4 +77,5 @@
 
     psPtr rawDataBuffer;               ///< Raw data buffer for Allocating/Freeing Images
+    void *lock;                        ///< Optional lock for thread safety
 }
 psImage;
@@ -103,8 +104,9 @@
  */
 psImage* psImageAlloc(
-    psU32 numCols,                     ///< Number of rows in image.
-    psU32 numRows,                     ///< Number of columns in image.
+    int numCols,                       ///< Number of rows in image.
+    int numRows,                       ///< Number of columns in image.
     psElemType type                    ///< Type of data for image.
-);
+)
+;
 
 /** Create a psRegion with the specified attributes.
@@ -113,8 +115,8 @@
  */
 psRegion psRegionSet(
-    float x0,                         ///< the first column of the region.
-    float x1,                         ///< the last column of the region + 1.
-    float y0,                         ///< the first row of the region.
-    float y1                          ///< the last row of the region + 1.
+    float x0,                          ///< the first column of the region.
+    float x1,                          ///< the last column of the region + 1.
+    float y0,                          ///< the first row of the region.
+    float y1                           ///< the last row of the region + 1.
 );
 
@@ -146,6 +148,6 @@
 psImage* psImageRecycle(
     psImage* old,                      ///< the psImage to recycle by resizing image buffer
-    psU32 numCols,                     ///< the desired number of columns in image
-    psU32 numRows,                     ///< the desired number of rows in image
+    int numCols,                       ///< the desired number of columns in image
+    int numRows,                       ///< the desired number of rows in image
     const psElemType type              ///< the desired datatype of the image
 );
Index: trunk/psLib/src/image/psImageStructManip.c
===================================================================
--- trunk/psLib/src/image/psImageStructManip.c	(revision 4493)
+++ trunk/psLib/src/image/psImageStructManip.c	(revision 4526)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-07 02:17:53 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-09 01:24:30 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -31,5 +31,15 @@
 {
     psU32 elementSize;          // size of image element in bytes
-    psU32 inputColOffset;       // offset in bytes to first subset pixel in input row
+    psS32 inputColOffset;       // offset in bytes to first subset pixel in input row
+
+    if ( col0 < 0 || row0 < 0 ) {
+        //        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+        //                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
+                col0, col1-1, row0, row1-1,
+                image->numCols-1, image->numRows-1);
+        return NULL;
+    }
 
     if (image == NULL || image->data.V == NULL) {
@@ -64,4 +74,7 @@
         return NULL;
     }
+
+
+
     psS32 numRows = row1-row0;
     psS32 numCols = col1-col0;
@@ -95,6 +108,8 @@
     out->data.V = psRealloc(out->data.V,sizeof(psPtr)*numRows); // resize row pointer array
     *(psMathType*)&out->type = image->type;
-    *(psU32*)&out->numCols = numCols;
-    *(psU32*)&out->numRows = numRows;
+    //    *(psU32*)&out->numCols = numCols;
+    //    *(psU32*)&out->numRows = numRows;
+    *(psS32*)&out->numCols = numCols;
+    *(psS32*)&out->numRows = numRows;
     *(psS32*)&out->row0 = row0;
     *(psS32*)&out->col0 = col0;
