IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41504


Ignore:
Timestamp:
Feb 24, 2021, 10:29:51 AM (5 years ago)
Author:
eugene
Message:

add some commented-out memory check lines

File:
1 edited

Legend:

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

    r38538 r41504  
    308308    psFitsOptions *options = fits->options; // Options for FITS writing
    309309
     310    // psMemCheckCorruption (stderr, true); // 1
     311
    310312    // Can't PLIO compress U16,U32,U64 directly, so convert them
    311313    if (psFitsCompressionGetType(fits) == PS_FITS_COMPRESS_PLIO && (!options || options->bitpix == 0)) {
     
    329331    }
    330332
     333    // psMemCheckCorruption (stderr, true); // 1x
     334
    331335    // Custom floating-point
    332336    if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->conventions.psBitpix &&
     
    340344        return psMemIncrRefCounter((psImage*)image); // Casting away const
    341345    }
     346
     347    // psMemCheckCorruption (stderr, true); // 2
    342348
    343349    // Quantise floating-point images
     
    358364                return NULL;
    359365            }
     366
     367            // psMemCheckCorruption (stderr, true); // 2x
     368
    360369            status = 0;
    361370            if (fits_read_key_dbl(fits->fd, "BZERO", bzero, NULL, &status) && status != KEY_NO_EXIST) {
     
    369378                return NULL;
    370379            }
     380
     381            // psMemCheckCorruption (stderr, true); // 3
     382
    371383        }
    372384
     
    404416    break;
    405417
     418
     419    // psMemCheckCorruption (stderr, true); // 4
     420
    406421    *bscale = 1.0;
    407422    *bzero = 0.0;
     
    421436    }
    422437
     438    // psMemCheckCorruption (stderr, true); // 3x
     439
    423440    if (outType == inType) {
    424441        return psMemIncrRefCounter((psImage*)image);
    425442    }
    426443
     444    // psMemCheckCorruption (stderr, true); // 5
     445
    427446    if (PSELEMTYPE_SIZEOF(inType) > PSELEMTYPE_SIZEOF(outType)) {
    428447        psWarning("Truncating image pixels to write to disk.");
    429448    }
     449
     450    // psMemCheckCorruption (stderr, true); // 4x
    430451
    431452    return psImageCopy(NULL, image, outType);
     
    647668    }
    648669
     670    // fprintf (stderr, "calling psFitsInsertImageWithMask for %s, %lx, %lx\n", fits->fd->Fptr->filename, (long int) image, (long int) mask);
     671
    649672    int numCols = image->numCols;       // Number of columns for image
    650673    int numRows = image->numRows;       // Number of rows for image
     
    659682    psFitsFloat floatType;              // Custom floating-point convention type
    660683
     684    // psMemCheckCorruption (stderr, true);
     685
    661686    psImage *diskImage = imageToDiskRepresentation(&bscale, &bzero, &boffset, &bsoften, &blank, &floatType,
    662687                                                   fits, image, mask, maskVal, NULL, true); // Image to write out
     688
     689    // psMemCheckCorruption (stderr, true);
     690
     691    // fprintf (stderr, "allocated in psFitsInsertImageWithMask %s, %lx\n", fits->fd->Fptr->filename, (long int) diskImage);
    663692
    664693    if (!diskImage) {
     
    721750        naxis = 2;
    722751    }
     752
     753    // psMemCheckCorruption (stderr, true);
    723754
    724755    bool createPHU = false;             // Are we creating a PHU?
     
    864895    }
    865896
     897    // psMemCheckCorruption (stderr, true);
     898
    866899    if (psFitsError(status, true, "Could not write image to file.")) {
    867900        success = false;
     
    877910    }
    878911
     912
     913    // psMemCheckCorruption (stderr, true);
    879914
    880915 INSERT_DONE:
Note: See TracChangeset for help on using the changeset viewer.