Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 35418)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 35432)
@@ -360,5 +360,6 @@
 
     my $wholefile = 0;
-    if (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0) {
+    if (($row->{WIDTH} == 0 && $row->{HEIGHT} == 0) ||
+       (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0)) {
         # Secret code for returning the whole file
         $wholefile = 1;
@@ -628,23 +629,32 @@
     my $h = $row->{HEIGHT};
     my $coord_mask = $row->{COORD_MASK};
+
     my $wholeFile = 0; 
-    if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
-        # Center of 0, 0 in pixel coordinates is interpreted to mean
-        # return the entire file
-        if ($x == 0 && $y == 0) {
-            $roi_string = "-wholefile";
-            $wholeFile = 1;
+    # For historical reasons there are two ways to specify that the entire file be returned 
+    # rather than a postage stamp ...
+    if ($w == 0 and $h == 0) {
+        # ... The right way: width and height both zero ...
+        $wholeFile = 1;
+    } else {
+        if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
+            if ($x == 0 && $y == 0) {
+                # ... and pixel coordinate center of 0, 0
+                # I made this one up without thinking through the API clearly.
+                # allowing width and height to do it works much better
+                $wholeFile = 1;
+            } else {
+                $roi_string = "-pixcenter $x $y";
+            }
         } else {
-            $roi_string = "-pixcenter $x $y";
-        }
+            $roi_string = "-skycenter $x $y";
+        }
+    }
+
+    if ($wholeFile) {
+        $roi_string = "-wholefile";
+    } elsif ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
+            $roi_string .= " -pixrange $w $h";
     } else {
-        $roi_string = "-skycenter $x $y";
-    }
-    if (!$wholeFile) {
-        if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
-            $roi_string .= " -pixrange $w $h";
-        } else {
             $roi_string .= " -arcrange $w $h";
-        }
     }
 
