IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 25, 2010, 2:07:17 PM (16 years ago)
Author:
Paul Price
Message:

An 'image' can be an empty table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsTable.c

    r28216 r28507  
    6767        return false;
    6868    }
     69    if (hdutype == IMAGE_HDU) {
     70        // It could be an empty table
     71        long size = 0;                  // Size of 'table'
     72        if (fits_get_num_rows(fits->fd, &size, &status)) {
     73            psFitsError(status, true, "Unable to determine size of table.");
     74            return false;
     75        }
     76        if (size != 0) {
     77            psFitsError(PS_ERR_BAD_FITS, true, "Current FITS HDU is not a table.");
     78            return false;
     79        }
     80    }
    6981    if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) {
    70         psError(PS_ERR_IO, true, _("Current FITS HDU is not a table."));
     82        psError(PS_ERR_BAD_FITS, true, _("Current FITS HDU is not a table."));
    7183        return false;
    7284    }
Note: See TracChangeset for help on using the changeset viewer.