Index: trunk/ppImage/src/ppTest.c
===================================================================
--- trunk/ppImage/src/ppTest.c	(revision 8776)
+++ trunk/ppImage/src/ppTest.c	(revision 8822)
@@ -11,4 +11,6 @@
 int main(int argc, char *argv[])
 {
+    psLibInit(NULL);
+
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -99,5 +101,5 @@
 
 
-#if 1
+#if 0
     // A mosaic
     psMetadata *mosaicCamera = psMetadataConfigRead(NULL, NULL, "/home/mithrandir/price/ipp/config/mcshort_mosaic/camera.config", true);
@@ -112,5 +114,5 @@
     pmFPARead(fpa, inFile, NULL);
 
-#if 0
+#if 1
     psArray *chips = fpa->chips;
     pmFPAWrite(fpa, outFile, NULL, false, false);
@@ -118,12 +120,12 @@
         printf("Chip %d\n", i);
         pmChip *chip = chips->data[i];
-        pmChipRead(chip, inFile, NULL);
-#if 0
+#if 1
         //pmChipRead(chip, inFile, NULL);
-        //pmChipWrite(chip, outFile, NULL, false);
+        pmChipWrite(chip, outFile, NULL, false, false);
         psArray *cells = chip->cells;
         for (int j = 0; j < cells->n; j++) {
             pmCell *cell = cells->data[j];
-            //pmCellWrite(cell, outFile, NULL, false);
+            pmCellWrite(cell, outFile, NULL, false);
+#if 0 // Read bit by bit
             pmReadout *readout = pmReadoutAlloc(cell);
             for (int z = 0; pmReadoutReadNext(readout, inFile, z, 512); z++) {
@@ -135,14 +137,21 @@
             }
             psFree(readout);
+#else // Read the whole cell at once
+            pmCellRead(cell, inFile, NULL);
+            pmCellWrite(cell, outFile, NULL, true);
+#endif
         }
 #endif
+
+#if 0
         pmChipMosaic(mosaicFPA->chips->data[i], chip);
         pmChipWrite(mosaicFPA->chips->data[i], outFile, NULL, true, true);
         pmChipFreeData(chip);
         pmChipFreeData(mosaicFPA->chips->data[i]);
+#endif
     }
 #endif
 
-#if 1
+#if 0
     pmFPAMosaic(mosaicFPA, fpa);
     pmFPAWrite(mosaicFPA, outFile, NULL, true, true);
@@ -152,4 +161,8 @@
     psFree(mosaicView);
     //psFree(mosaicFPA);
+#endif
+
+#if 1
+    pmFPAPrint(stdout, fpa, true, true);
 #endif
 
@@ -165,12 +178,7 @@
     psFree(cameraFormat);
 
-    psTimerStop();
-    psTraceReset();
-    psErrorClear();
     pmConceptsDone();
     pmConfigDone();
-
-
-    ppMemCheck();
+    psLibFinalize();
 
     // Pau.
