Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 27522)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 27524)
@@ -233,4 +233,11 @@
     # user requested us to search all components. Set to ""
     $search_component = "" if $search_component eq "all";
+
+    if (!check_image_type($stage)) {
+        print STDERR "invalid IMG_TYPE for row $rownum\n" if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
+        $num_jobs++;
+        next;
+    }
 
     if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) {
@@ -958,4 +965,20 @@
 }
 
+sub check_image_type
+{
+    my $img_type = shift;
+    if (!$img_type) {
+	    print STDERR "NULL IMG_TYPE supplied\n";
+	    return 0;
+    }
+    if (($img_type eq "raw") or ($img_type eq "chip") or ($img_type eq "warp") or
+	($img_type eq "stack") or ($img_type eq "diff")) {
+	return 1;
+    } else {
+	print STDERR "$img_type is not a valid IMG_TYPE\n";
+	return 0;
+    }
+}
+
 sub my_die
 {
