Index: trunk/Ohana/src/addstar/src/ReadImageHeader.c
===================================================================
--- trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 19125)
+++ trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 19130)
@@ -19,6 +19,6 @@
   // 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) {
Index: trunk/Ohana/src/opihi/dvo/imbox.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/imbox.c	(revision 19125)
+++ trunk/Ohana/src/opihi/dvo/imbox.c	(revision 19130)
@@ -3,5 +3,5 @@
 int imbox (int argc, char **argv) {
   
-  int j, kapa, Nskip, status, InPic, flipped, N, SOLO_PHU;
+  int j, kapa, Nskip, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU;
   Vector Xvec, Yvec;
   double r, d, x[4], y[4], Rmin, Rmax, Rmid;
@@ -46,8 +46,24 @@
       goto skip;
     }
-    x[0] = 0;               y[0] = 0;
-    x[1] = header.Naxis[0]; y[1] = 0;
-    x[2] = header.Naxis[0]; y[2] = header.Naxis[1];
-    x[3] = 0;               y[3] = header.Naxis[1];
+
+    // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive
+    // and needs to be at least checked.
+    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");
+	goto skip;
+    }
+
+    x[0] = 0;  y[0] = 0;
+    x[1] = Nx; y[1] = 0;
+    x[2] = Ny; y[2] = Ny;
+    x[3] = 0;  y[3] = Ny;
     status = FALSE;
     flipped = FALSE;
