Index: trunk/ppImage/src/ppImageLoop.c
===================================================================
--- trunk/ppImage/src/ppImageLoop.c	(revision 35770)
+++ trunk/ppImage/src/ppImageLoop.c	(revision 35846)
@@ -41,5 +41,5 @@
         ESCAPE("load failure for FPA");
     }
-    
+
     pmChip *chip;                       // Chip from FPA
     while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) {
@@ -134,4 +134,5 @@
                     ESCAPE("Unable to degrade MD image to 3pi");
 		}
+
             }
 
@@ -156,4 +157,5 @@
                 ESCAPE("Unable to free detrend images");
             }
+
         }
         // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
@@ -168,4 +170,5 @@
             }
         }
+
         // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
         if (!ppImageFringeFree (config, view)) {
@@ -218,5 +221,5 @@
 	  }
 	}
-	
+
         // these may be used by ppImageSubtractBackground.
         // if these are defined as internal files, drop them here
@@ -232,14 +235,20 @@
 
         // binning (used for display) must take place after the background is replaced, if desired
-        if (!ppImageRebinChip(config, view, options, "PPIMAGE.BIN1")) {
+	if ((options->Bin1FITS)||(options->Bin1JPEG)||(options->FPA1FITS)) {
+	  if (!ppImageRebinChip(config, view, options, "PPIMAGE.BIN1")) {
             ESCAPE("Unable to bin chip (level 1).");
-        }
-        if (!ppImageRebinChip(config, view, options, "PPIMAGE.BIN2")) {
+	  }
+	}
+	if ((options->Bin2FITS)||(options->Bin2JPEG)||(options->FPA2FITS)) {
+	  if (!ppImageRebinChip(config, view, options, "PPIMAGE.BIN2")) {
             ESCAPE("Unable to bin chip (level 2).");
-        }
+	  }
+	}
+
 	if (options->doBackgroundContinuity) {
 	  pmFPAfile *out = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.BACKMDL");
 	  pmFPAfileCopyView(out->fpa,out->src,view);
 	}
+
         // Close cells (XXX shouldn't pmFPAfileClose iterate down as needed?)
         view->cell = -1;
@@ -263,11 +272,15 @@
       ESCAPE("failure in Background Mosaic");
     }
-    
+
     // generate the full-scale FPA mosaic
-    if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1")) {
+    if (options->FPA1FITS) {
+      if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1")) {
         ESCAPE("failure in FPA Mosaic (level 1)");
-    }
-    if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2")) {
+      }
+    }
+    if (options->FPA2FITS) {
+      if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2")) {
         ESCAPE("failure in FPA Mosaic (level 2)");
+      }
     }
 
@@ -283,5 +296,5 @@
         ppImageFileCheck(config);
     }
-    
+
     // Calculate summary statistics from FPA Metadata
     if (!ppImageMetadataStats(config, stats, options)) {
