Index: /branches/eam_branches/ohana.20150429/src/libfits/Makefile
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/Makefile	(revision 38334)
+++ /branches/eam_branches/ohana.20150429/src/libfits/Makefile	(revision 38335)
@@ -26,5 +26,5 @@
 TEST_LDFLAGS  = $(BASE_LDFLAGS) -lFITS -lohana -ltap_ohana
 
-TESTPROG = tablecomp zlib
+TESTPROG = imagecomp tablecomp zlib
 $(TESTPROG) : % : $(TESTBIN)/%
 test: $(TESTPROG)
Index: /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h	(revision 38334)
+++ /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h	(revision 38335)
@@ -268,4 +268,5 @@
 
 int     gfits_compress_table           PROTO((FTable *srctable, FTable *tgttable, int ztilelen, char *zcmptype));
+int     gfits_uncompress_table         PROTO((FTable *srctable, FTable *tgttable));
 
 #endif /* FITSIO */
Index: /branches/eam_branches/ohana.20150429/src/libfits/table/F_uncompress_T.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/table/F_uncompress_T.c	(revision 38334)
+++ /branches/eam_branches/ohana.20150429/src/libfits/table/F_uncompress_T.c	(revision 38335)
@@ -7,5 +7,5 @@
 int gfits_distribute_table_data (FTable *table, char *raw, int col, int row_start, int Nrows, int rowsize);
 
-int gfits_uncompress_table (FTable *srctable, FTable *tgttable, char *zcmptype) {
+int gfits_uncompress_table (FTable *srctable, FTable *tgttable) {
 
   int i;
Index: /branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c	(revision 38335)
+++ /branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c	(revision 38335)
@@ -0,0 +1,82 @@
+# include <ohana.h>
+# include <gfitsio.h>
+# include "tap_ohana.h"
+
+int test_compress (char *zcmptype);
+
+int main (int argc, char **argv) {
+  
+  plan_tests (64);
+
+  diag ("libfits imagecomp.c tests");
+
+  test_compress ("NONE");
+  test_compress ("GZIP_1");
+
+  exit (0);
+}
+
+# define NX 100
+# define NY 100
+
+int test_compress (char *zcmptype) { // make a table, compress, uncompress, compare : use compression zcmptype
+
+  Header rawheader;
+  Matrix rawmatrix;
+  Header outheader;
+  Matrix outmatrix;
+
+  Header theader;
+  FTable ftable;
+  ftable.header = &theader;
+
+  diag ("--- starting test_compress with zcmptype %s ---", zcmptype);
+  ok (gfits_init_header (&rawheader), "init'ed the raw header");
+  ok (gfits_init_matrix (&rawmatrix), "init'ed the raw matrix");
+  ok (gfits_init_header (&outheader), "init'ed the out header");
+  ok (gfits_init_matrix (&outmatrix), "init'ed the out matrix");
+
+  /* assign the necessary internal values */
+  rawheader.bitpix   = -32;
+  rawheader.Naxes = 2;
+  rawheader.Naxis[0] = NX;
+  rawheader.Naxis[1] = NY;
+
+  /* create the appropriate header and matrix */
+  ok (gfits_create_header (&rawheader),          "created header");
+  ok (gfits_create_matrix (&rawheader, &rawmatrix), "created matrix");
+
+  float *rawdata = (float *) rawmatrix.buffer;
+  int ix, iy;
+  for (ix = 0; ix < NX; ix++) {
+    for (iy = 0; iy < NY; iy++) {
+      rawdata[ix + NX*iy] = ix * iy*iy;
+    }
+  }     
+
+  ok (gfits_compress_image (&rawheader, &rawmatrix, &ftable, NULL, zcmptype), "compressed image");
+
+  ok (gfits_uncompress_image (&outheader, &outmatrix, &ftable), "uncompressed image");
+  
+  gfits_free_header (&theader);
+  gfits_free_table (&ftable);
+  
+  int Nbad = 0;
+
+  float *outdata = (float *) outmatrix.buffer;
+  for (ix = 0; ix < NX; ix++) {
+    for (iy = 0; iy < NY; iy++) {
+      if (rawdata[ix + NX*iy] != outdata[ix + NX*iy]) Nbad ++;
+    }
+  }     
+  
+  ok (!Nbad, "all image pixels match");
+
+  gfits_free_header (&rawheader);
+  gfits_free_matrix (&rawmatrix);
+
+  gfits_free_header (&outheader);
+  gfits_free_matrix (&outmatrix);
+  return TRUE;
+}
+
Index: /branches/eam_branches/ohana.20150429/src/libfits/test/tablecomp.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/test/tablecomp.c	(revision 38334)
+++ /branches/eam_branches/ohana.20150429/src/libfits/test/tablecomp.c	(revision 38335)
@@ -69,5 +69,5 @@
     FTable rawtable;
     rawtable.header = &rawheader;
-    ok (gfits_uncompress_table (&cmptable, &rawtable, 10, zcmptype), "uncompressed table");
+    ok (gfits_uncompress_table (&cmptable, &rawtable), "uncompressed table");
     
     gfits_free_header (&cmpheader);
