Index: trunk/psLib/src/fits/psFits.c
===================================================================
--- trunk/psLib/src/fits/psFits.c	(revision 14871)
+++ trunk/psLib/src/fits/psFits.c	(revision 14872)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-17 22:48:36 $
+ *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-17 23:01:00 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -565,6 +565,5 @@
     psFits* fits,                       ///< psFits object to close
     psFitsCompressionType type,         ///< type of compression
-    int ndim,                           ///< number of dim in tile size array
-    long *tilesize,                     ///< pointer to an array defining compression tile size
+    psVector *tilesize,
     int noisebits,                      ///< noise bits
     int scale,                          ///< hcompress scale
@@ -600,8 +599,21 @@
         goto ERROR;
     }
-    fits_set_tile_dim(fits->fd, ndim, tilesize, &status);
+
+    // convert a psVector into the (long *) array that cfitsio requires
+    psVector *dim = NULL;
+    if (sizeof(long) == sizeof(psS64)) {
+        dim = psVectorCopy(NULL, tilesize, PS_DATA_S64);
+        fits_set_tile_dim(fits->fd, psVectorLength(dim), (long *)dim->data.S64, &status);
+    } else if (sizeof(long) == sizeof(psS32)) {
+        dim = psVectorCopy(NULL, tilesize, PS_DATA_S32);
+        fits_set_tile_dim(fits->fd, psVectorLength(dim), (long *)dim->data.S32, &status);
+    } else {
+        psAbort("can't map (long) type to a psLib type");
+    }
+    // status check belongs to fits_set_tile_dim() call
     if (!status) {
         goto ERROR;
     }
+
     fits_set_noise_bits(fits->fd, noisebits, &status);
     if (!status) {
