Index: trunk/ppImage/src/ppImageLoop.c
===================================================================
--- trunk/ppImage/src/ppImageLoop.c	(revision 25847)
+++ trunk/ppImage/src/ppImageLoop.c	(revision 25875)
@@ -99,11 +99,8 @@
                 }
 
-                // perform the detrend analysis
-                if (!ppImageParityFlip(config, options, view)) {
+                // flip the image to match the native detector orientation (to match bias, flat, etc)
+		if (!ppImageParityFlip(config, options, view, true)) {
                     ESCAPE("Unable to detrend readout");
                 }
-
-                // XXX TEST:
-                // psphotSaveImage (NULL, readout->image, "test.image.fits");
 
                 // XXX set the options->*Mask values here (after the mask images have been loaded
@@ -132,4 +129,17 @@
                 ppImageDetrendRecord(cell, config, options, view);
             }
+
+            // process each of the readouts
+	    // XXX reset the view to the first readout?
+            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
+                if (!readout->data_exists) {
+                    continue;
+                }
+                // flip the image to match the raw readout orientation
+                if (!ppImageParityFlip(config, options, view, false)) {
+                    ESCAPE("Unable to detrend readout");
+                }
+	    }
+
             // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
             if (!ppImageDetrendFree (config, view)) {
@@ -161,5 +171,4 @@
         }
         timeDetrend += psTimerClear(TIMER_DETREND);
-
 
         // we perform photometry on the readouts of this chip in the output
