Index: trunk/psModules/src/camera/pmFPACopy.c
===================================================================
--- trunk/psModules/src/camera/pmFPACopy.c	(revision 7382)
+++ trunk/psModules/src/camera/pmFPACopy.c	(revision 7419)
@@ -8,5 +8,4 @@
 #include "pmHDU.h"
 #include "pmHDUUtils.h"
-#include "pmHDUGenerate.h"
 
 #include "pmFPACopy.h"
@@ -116,43 +115,70 @@
         targetReadout->data_exists = sourceReadout->data_exists;
 
-        if (pixels) {
-            // Copy image
-            if (sourceReadout->image) {
-                if (targetReadout->image) {
-                    psFree(targetReadout->image);
-                }
+        // Copy image
+        if (sourceReadout->image) {
+            if (targetReadout->image) {
+                psFree(targetReadout->image);
+            }
+            if (pixels) {
                 targetReadout->image = psImageFlip(NULL, sourceReadout->image, xFlip, yFlip);
-            }
-
-            // Copy mask
-            if (sourceReadout->mask) {
-                if (targetReadout->mask) {
-                    psFree(targetReadout->mask);
-                }
+            } else {
+                psImage *image = sourceReadout->image; // The source image
+                long binnedCols = (image->numCols + xBin - 1) / xBin;
+                long binnedRows = (image->numRows + yBin - 1) / yBin;
+                targetReadout->image = psImageAlloc(binnedCols, binnedRows, image->type.type);
+            }
+        }
+
+        // Copy mask
+        if (sourceReadout->mask) {
+            if (targetReadout->mask) {
+                psFree(targetReadout->mask);
+            }
+            if (pixels) {
                 targetReadout->mask = psImageFlip(NULL, sourceReadout->mask, xFlip, yFlip);
-            }
-
-            // Copy weight
-            if (sourceReadout->weight) {
-                if (targetReadout->weight) {
-                    psFree(targetReadout->weight);
-                }
+            } else {
+                psImage *mask = sourceReadout->mask; // The source mask image
+                long binnedCols = (mask->numCols + xBin - 1) / xBin;
+                long binnedRows = (mask->numRows + yBin - 1) / yBin;
+                targetReadout->mask = psImageAlloc(binnedCols, binnedRows, mask->type.type);
+            }
+        }
+
+        // Copy weight
+        if (sourceReadout->weight) {
+            if (targetReadout->weight) {
+                psFree(targetReadout->weight);
+            }
+            if (pixels) {
                 targetReadout->weight = psImageFlip(NULL, sourceReadout->weight, xFlip, yFlip);
-            }
-
-            // Copy bias
-            while (targetReadout->bias->n > 0) {
-                psListRemove(targetReadout->bias, PS_LIST_HEAD);
-            }
-            // Iterate over the biases
-            psListIterator *biasIter = psListIteratorAlloc(sourceReadout->bias, PS_LIST_HEAD, false);
-            psImage *bias = NULL;           // Bias image from iteration
-            while ((bias = psListGetAndIncrement(biasIter))) {
-                psImage *biasCopy = psImageFlip(NULL, bias, xFlip, yFlip);
-                psListAdd(targetReadout->bias, PS_LIST_TAIL, biasCopy);
-                psFree(biasCopy);           // Drop reference
-            }
-            psFree(biasIter);
-        }
+            } else {
+                psImage *weight = sourceReadout->weight; // The source weight image
+                long binnedCols = (weight->numCols + xBin - 1) / xBin;
+                long binnedRows = (weight->numRows + yBin - 1) / yBin;
+                targetReadout->weight = psImageAlloc(binnedCols, binnedRows, weight->type.type);
+            }
+        }
+
+        // Copy bias
+        while (targetReadout->bias->n > 0) {
+            psListRemove(targetReadout->bias, PS_LIST_HEAD);
+        }
+        // Iterate over the biases
+        psListIterator *biasIter = psListIteratorAlloc(sourceReadout->bias, PS_LIST_HEAD, false);
+        psImage *bias = NULL;           // Bias image from iteration
+        while ((bias = psListGetAndIncrement(biasIter))) {
+            psImage *biasCopy;          // Copy of the bias
+            if (pixels) {
+                biasCopy = psImageFlip(NULL, bias, xFlip, yFlip);
+            } else {
+                long binnedCols = (bias->numCols + xBin - 1) / xBin;
+                long binnedRows = (bias->numRows + yBin - 1) / yBin;
+                biasCopy = psImageAlloc(binnedCols, binnedRows, bias->type.type);
+            }
+            psListAdd(targetReadout->bias, PS_LIST_TAIL, biasCopy);
+            psFree(biasCopy);           // Drop reference
+        }
+        psFree(biasIter);
+
         psFree(targetReadout);          // Drop reference
     }
