Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 30050)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 33504)
@@ -233,10 +233,5 @@
     int status = false;
 
-    pmFPAfile *output;
-    if (!options->stage || (strcmp(options->stage, "diff") != 0)) {
-        output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT");
-    } else {
-        output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT.DIFF");
-    }
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, options->outputFileRule);
     if (!output) {
         psError(PS_ERR_UNKNOWN, false, "Can't find output data\n");
@@ -529,7 +524,14 @@
         // If no chip name was specified, select this one (the first one that had data)
         if ((options->chipName == NULL) || !strcasecmp(chipName, options->chipName)) {
-            psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName);
-            center->chip->x = options->roip.centerX;
-            center->chip->y = options->roip.centerY;
+            if (options->chipName) {
+                psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName);
+            }
+            if (options->wholeFile) {
+                center->chip->x = (chipBounds->x1 + chipBounds->x0 + 1) / 2;
+                center->chip->y = (chipBounds->y1 + chipBounds->y0 + 1) / 2;
+            } else {
+                center->chip->x = options->roip.centerX;
+                center->chip->y = options->roip.centerY;
+            }
             center->chip->xErr = 0;
             center->chip->yErr = 0;
@@ -543,25 +545,28 @@
             findBoundingBox(options, input->fpa, chip, center);
         } else {
-            int width  = options->roip.dX;
-            int height = options->roip.dY;
-            if (width > 5000) {
-                fprintf(stderr, "requested width %d too large reducing to 5000\n", width);
-                width = 5000;
+            if (options->wholeFile) { 
+                options->roi = *chipBounds;
+            } else {
+                int width  = options->roip.dX;
+                int height = options->roip.dY;
+                if (width > 7000) {
+                    fprintf(stderr, "requested width %d too large reducing to 7000\n", width);
+                    width = 7000;
+                }
+                if (height > 7000) {
+                    fprintf(stderr, "requested height %d too large reducing to 7000\n", height);
+                    height = 7000;
+                }
+
+                // calculate the ROI in chip coordinates
+                options->roi.x0 = center->chip->x - width / 2;
+                options->roi.x1 = options->roi.x0 + width;
+                options->roi.y0 = center->chip->y - height / 2;
+                options->roi.y1 = options->roi.y0 + height;
             }
-            if (height > 5000) {
-                fprintf(stderr, "requested height %d too large reducing to 5000\n", height);
-                height = 5000;
-            }
-
-            // calculate the ROI in chip coordinates
-            options->roi.x0 = center->chip->x - width / 2;
-            options->roi.x1 = options->roi.x0 + width;
-            options->roi.y0 = center->chip->y - height / 2;
-            options->roi.y1 = options->roi.y0 + height;
-        }
-
-
-        if (regionContainsRegion(chipBounds, &options->roi)) {
-            // returnval = findCell(view, options, input, center, ppCell);
+        }
+
+
+        if (options->wholeFile || regionContainsRegion(chipBounds, &options->roi)) {
             psLogMsg("ppstampMakeStamp", 2, "ROI contained on: %s\n", chipName);
             returnval = PPSTAMP_ON;
