Index: trunk/Ohana/src/addstar/src/GetFileMode.c
===================================================================
--- trunk/Ohana/src/addstar/src/GetFileMode.c	(revision 18732)
+++ trunk/Ohana/src/addstar/src/GetFileMode.c	(revision 19065)
@@ -5,11 +5,9 @@
 
   char ctype[80];
-  int Naxis, Nx, Ny;
-  int simple, extend, haveNaxis, haveNx, haveNy, haveCTYPE;
+  int Naxis;
+  int simple, extend, haveNaxis, haveCTYPE;
 
   gfits_scan (header, "SIMPLE", "%t", 1, &simple);
   haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
-  haveNx    = gfits_scan (header, "NAXIS1", "%d", 1, &Nx);
-  haveNy    = gfits_scan (header, "NAXIS2", "%d", 1, &Ny);
   haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
 
Index: trunk/Ohana/src/addstar/src/ReadImageHeader.c
===================================================================
--- trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 18732)
+++ trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 19065)
@@ -5,5 +5,5 @@
 int ReadImageHeader (Header *header, Image *image, int photcode) {
 
-  int Nastro, ccdnum, hour, min, Nx, Ny;
+  int Nastro, ccdnum, hour, min, Nx, Ny, haveNx, haveNy;
   double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y;
   char *c, photname[64], line[80];
@@ -21,7 +21,19 @@
   gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
   gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
+
+  if (!haveNx && !haveNy) {
+      haveNx = gfits_scan (header, "IMNAXIS1",   "%d", 1, &Nx);
+      haveNy = gfits_scan (header, "IMNAXIS2",   "%d", 1, &Ny);
+  }
+
+  if (!haveNx || !haveNy) {
+      fprintf (stderr, "missing image dimensions in header\n");
+      return (FALSE);
+  }
+
   if ((Nx < 0) || (Nx > 0xffff)) {
     fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n");
   }
+
   image[0].NX = Nx;
   image[0].NY = Ny;
Index: trunk/Ohana/src/delstar/src/gimages.c
===================================================================
--- trunk/Ohana/src/delstar/src/gimages.c	(revision 18732)
+++ trunk/Ohana/src/delstar/src/gimages.c	(revision 19065)
@@ -12,5 +12,5 @@
   double tmp;
   Image *image;
-  int Nc;
+  int Nc, haveNx, haveNy;
 
   ALLOCATE (image, Image, 1);
@@ -48,6 +48,13 @@
  
   /* get other header info */
-  gfits_scan (&header, "NAXIS1",   "%hd", 1, &image[0].NX); 
-  gfits_scan (&header, "NAXIS2",   "%hd", 1, &image[0].NY);
+  haveNx = gfits_scan (&header, "NAXIS1",   "%hd", 1, &image[0].NX); 
+  haveNy = gfits_scan (&header, "NAXIS2",   "%hd", 1, &image[0].NY);
+  if (!haveNx && !haveNy) {
+      haveNx = gfits_scan (&header, "IMNAXIS1",   "%hd", 1, &image[0].NX); 
+      haveNy = gfits_scan (&header, "IMNAXIS2",   "%hd", 1, &image[0].NY);
+  }      
+  if (!haveNx || !haveNy) {
+      Shutdown ("ERROR: missing image dimensions in header");
+  }
 
   gfits_scan (&header, "PHOTCODE", "%s", 1, photcode);
Index: trunk/Ohana/src/getstar/src/GetFileMode.c
===================================================================
--- trunk/Ohana/src/getstar/src/GetFileMode.c	(revision 18732)
+++ trunk/Ohana/src/getstar/src/GetFileMode.c	(revision 19065)
@@ -5,11 +5,9 @@
 
   char ctype[80];
-  int Naxis, Nx, Ny;
-  int simple, extend, haveNaxis, haveNx, haveNy, haveCTYPE;
+  int Naxis;
+  int simple, extend, haveNaxis, haveCTYPE;
 
   gfits_scan (header, "SIMPLE", "%t", 1, &simple);
   haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
-  haveNx    = gfits_scan (header, "NAXIS1", "%d", 1, &Nx);
-  haveNy    = gfits_scan (header, "NAXIS2", "%d", 1, &Ny);
   haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
 
Index: trunk/Ohana/src/getstar/src/ReadImageHeader.c
===================================================================
--- trunk/Ohana/src/getstar/src/ReadImageHeader.c	(revision 18732)
+++ trunk/Ohana/src/getstar/src/ReadImageHeader.c	(revision 19065)
@@ -4,5 +4,5 @@
 int ReadImageHeader (Header *header, Image *image) {
 
-  int Nastro, Nx, Ny;
+  int Nastro, Nx, Ny, haveNx, haveNy;
   double tmp;
 
@@ -14,6 +14,17 @@
   // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive
   // and needs to be at least checked.
-  gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
-  gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
+  haveNx = gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
+  haveNy = gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
+
+  if (!haveNx && !haveNy) {
+      haveNx = gfits_scan (header, "IMNAXIS1",   "%d", 1, &Nx);
+      haveNy = gfits_scan (header, "IMNAXIS2",   "%d", 1, &Ny);
+  }
+
+  if (!haveNx || !haveNy) {
+      fprintf (stderr, "missing image dimensions in header\n");
+      return (FALSE);
+  }
+
   if ((Nx < 0) || (Nx > 0xffff)) {
     fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n");
