IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 12:45:24 PM (17 years ago)
Author:
eugene
Message:

update from mainline

Location:
branches/eam_branches/20090715
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715

  • branches/eam_branches/20090715/psLib/src/fits/psFitsImage.c

    r22729 r25022  
    439439
    440440    p_psFitsReadInfo *info = p_psFitsReadInfoAlloc(fits, region, z);
     441    if (!info) {
     442        psError(PS_ERR_IO, false, "Unable to read FITS information");
     443        return NULL;
     444    }
    441445
    442446    // Size of image
     
    612616    }
    613617
     618    bool createPHU = false;             // Are we creating a PHU?
     619
    614620    // Create the image HDU
    615621    int hdus = psFitsGetSize(fits);     // Number of HDUs in file
     
    617623        // We're creating the first image
    618624        fits_create_img(fits->fd, bitPix, naxis, naxes, &status);
     625        createPHU = true;
    619626    } else {
    620627        if (!after) {
     
    623630                // Set status to signal fits_insert_img to insert a new primary HDU
    624631                status = PREPEND_PRIMARY;
     632                createPHU = true;
    625633            } else {
    626634                // Move back one to perform an insert after the previous HDU
     
    637645
    638646    // write the header, if any.
    639     if (header && !psFitsWriteHeader(fits, header)) {
     647    if (header && !psFitsWriteHeaderImage(fits, header, createPHU)) {
    640648        psError(PS_ERR_IO, false, "Unable to write FITS header.\n");
    641649        success = false;
Note: See TracChangeset for help on using the changeset viewer.