Index: /trunk/psModules/src/camera/pmFPAMosaic.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAMosaic.c	(revision 7633)
+++ /trunk/psModules/src/camera/pmFPAMosaic.c	(revision 7634)
@@ -466,45 +466,69 @@
             continue;
         }
+        int xParity = xFlip->data.U8[i] ? -1 : 1; // Parity difference, in x
+        int yParity = yFlip->data.U8[i] ? -1 : 1; // Parity difference, in y
         if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget &&
                 xFlip->data.U8[i] == 0 && yFlip->data.U8[i] == 0) {
             // Let someone else do the hard work; useful to test psImageOverlaySection if no other reason
             psImageOverlaySection(mosaic, image, x0->data.S32[i] - xMin, y0->data.S32[i] - yMin, "+");
+        } else if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) {
+            // There's a difference with the parities, but we don't have to worry about binning
+
+            #define COPY_WITH_PARITY_DIFFERENCE(TYPE) \
+        case PS_TYPE_##TYPE: { \
+                int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; \
+                int xTargetBase = (x0->data.S32[i] - xMin) / xBinTarget; \
+                for (int y = 0; y < image->numRows; y++) { \
+                    int yTarget =  yTargetBase + yParity * y; \
+                    for (int x = 0; x < image->numCols; x++) { \
+                        int xTarget = xTargetBase + xParity * x; \
+                        mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \
+                    } \
+                } \
+            } \
+            break;
+
+            switch (type) {
+                COPY_WITH_PARITY_DIFFERENCE(F32);
+                COPY_WITH_PARITY_DIFFERENCE(U8);
+            default:
+                psAbort(__func__, "Should never get here.\n");
+            }
+
         } else {
-            // We have to do the hard work ourself
-            for (int y = 0; y < image->numRows; y++) {
-                int yParity = yFlip->data.U8[i] ? -1 : 1;
-                float yTargetBase = (y0->data.S32[i] + yParity * yBinSource->data.S32[i] * y - yMin) /
-                                    yBinTarget;
-                for (int x = 0; x < image->numCols; x++) {
-                    int xParity = xFlip->data.U8[i] ? -1 : 1;
-                    float xTargetBase = (x0->data.S32[i] + xParity * xBinSource->data.S32[i] * x - xMin) /
-                                        xBinTarget;
-
-                    // In case the original image is binned but the mosaic is not, we need to fill in the
-                    // values in the mosaic.
-                    #define FILL_IN(TYPE)                                                                    \
-                    for (int j = 0; j < yBinSource->data.S32[i]; j++) {                                      \
-                        int yTarget = (int)(yTargetBase + yParity * (float)j / (float)yBinTarget);           \
-                        for (int k = 0; k < xBinSource->data.S32[i]; k++) {                                  \
-                            int xTarget = (int)(xTargetBase + xParity * (float)k / (float)xBinTarget);       \
-                            mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x];                   \
-                        }                                                                                    \
-                    }
-
-                    switch (type) {
-                    case PS_TYPE_F32:
-                        FILL_IN(F32);
-                        break;
-                    case PS_TYPE_U8:
-                        FILL_IN(U8);
-                        break;
-                    default:
-                        psAbort(__func__, "Should never get here.\n");
-                    }
-
-                }
-            } // Iterating over input image
-        }
-    }
+            // We have to do all of the hard work ourself
+
+            // In case the original image is binned but the mosaic is not, we need to fill in the
+            // values in the mosaic.
+
+
+            #define FILL_IN(TYPE) \
+        case PS_TYPE_##TYPE: \
+            for (int y = 0; y < image->numRows; y++) { \
+                float yTargetBase = (y0->data.S32[i] + yParity * yBinSource->data.S32[i] * y - yMin) / \
+                                    yBinTarget; \
+                for (int x = 0; x < image->numCols; x++) { \
+                    float xTargetBase = (x0->data.S32[i] + xParity * xBinSource->data.S32[i] * x - xMin) / \
+                                        xBinTarget; \
+                    for (int j = 0; j < yBinSource->data.S32[i]; j++) { \
+                        int yTarget = (int)(yTargetBase + yParity * (float)j / (float)yBinTarget); \
+                        for (int k = 0; k < xBinSource->data.S32[i]; k++) { \
+                            int xTarget = (int)(xTargetBase + xParity * (float)k / (float)xBinTarget); \
+                            mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \
+                        } \
+                    } \
+                } \
+            } \
+            break;
+
+            switch (type) {
+                FILL_IN(F32);
+                FILL_IN(U8);
+            default:
+                psAbort(__func__, "Should never get here.\n");
+            }
+
+        } // Various difficulty levels
+    } // Iterating over images
 
     return mosaic;
@@ -976,13 +1000,9 @@
     // Check to see if the target has a smaller binning in mind
     int xBinTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XBIN");
-    if (!mdok || xBinTarget == 0) {
-        psLogMsg(__func__, PS_LOG_WARN, "CELL.XBIN is not set for the target cell; assuming %d.\n", *xBinFPA);
-    } else {
+    if (mdok && xBinTarget != 0) {
         *xBinFPA = xBinTarget;
     }
     int yBinTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.YBIN");
-    if (!mdok || yBinTarget == 0) {
-        psLogMsg(__func__, PS_LOG_WARN, "CELL.YBIN is not set for the target cell; assuming %d.\n", *yBinFPA);
-    } else {
+    if (mdok && yBinTarget != 0) {
         *yBinFPA = yBinTarget;
     }
