Index: /branches/eam_branches/ipp-20220316/ppImage/src/ppImageDetrendPattern.c
===================================================================
--- /branches/eam_branches/ipp-20220316/ppImage/src/ppImageDetrendPattern.c	(revision 42213)
+++ /branches/eam_branches/ipp-20220316/ppImage/src/ppImageDetrendPattern.c	(revision 42214)
@@ -311,5 +311,5 @@
 	}
     }
-
+    return true;
 }
 
Index: /branches/eam_branches/ipp-20220316/ppImage/src/ppImageRebinReadout.c
===================================================================
--- /branches/eam_branches/ipp-20220316/ppImage/src/ppImageRebinReadout.c	(revision 42213)
+++ /branches/eam_branches/ipp-20220316/ppImage/src/ppImageRebinReadout.c	(revision 42214)
@@ -35,4 +35,8 @@
 
             // run the rebin code
+	    // XXX EAM 2022.04.21 : this function rebins the signal image and makes an attempt to
+	    // generate a mask only with bits raised in masked pixels that have > 50% of input pixels masked.
+	    // this step is very expensive because it must count the input mask bits for each pixel.
+	    // What is particularly silly is that the mask is not even used in the jpeg image.
             if (!pmReadoutRebin(outReadout, inReadout, options->maskValue, outFile->xBin, outFile->yBin)) {
                 psError(PS_ERR_UNKNOWN, false, "Unable to rebin readout.");
Index: /branches/eam_branches/ipp-20220316/ppImage/src/ppImageReplaceBackground.c
===================================================================
--- /branches/eam_branches/ipp-20220316/ppImage/src/ppImageReplaceBackground.c	(revision 42213)
+++ /branches/eam_branches/ipp-20220316/ppImage/src/ppImageReplaceBackground.c	(revision 42214)
@@ -81,6 +81,14 @@
     if (!modelFile || !modelRO) {
         if (!psphotModelBackgroundReadoutFileIndex(config, &roView, "PPIMAGE.CHIP", 0)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to model background");
-            return false;
+            int lastError = psErrorCodeLast();
+	    if (lastError == PSPHOT_ERR_DATA) {
+	      // a data error in psphotModelBackground* means an empty or bad image: skip background subtraction
+	      psErrorStackPrint(stderr, "Unable to model background");
+	      psErrorClear();
+	      return true;
+	    } else {
+	      psError(PS_ERR_UNKNOWN, false, "Unable to model background");
+	      return false;
+	    }
         }
         // the model file should now at least be defined
