IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8934 for trunk/ppImage/src


Ignore:
Timestamp:
Sep 25, 2006, 10:16:13 AM (20 years ago)
Author:
Paul Price
Message:

Adding error checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r8751 r8934  
    5959    // the following files are output targets
    6060    pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PPIMAGE.OUTPUT");
     61    if (!output) {
     62        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT"));
     63        psFree(options);
     64        return NULL;
     65    }
    6166    pmFPAfile *byChip = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.CHIP");
     67    if (!byChip) {
     68        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.OUTPUT.CHIP"));
     69        psFree(options);
     70        return NULL;
     71    }
    6272    pmFPAfile *byFPA1 = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.FPA1");
     73    if (!byFPA1) {
     74        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.OUTPUT.FPA1"));
     75        psFree(options);
     76        return NULL;
     77    }
    6378    pmFPAfile *byFPA2 = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.FPA2");
     79    if (!byFPA2) {
     80        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.OUTPUT.FPA2"));
     81        psFree(options);
     82        return NULL;
     83    }
    6484
    6585    // save any of these files?
     
    7494    // define the binned target files (which may just be carriers for some camera configurations)
    7595    pmFPAfile *bin1 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1");
     96    if (!bin1) {
     97        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BIN1"));
     98        psFree(options);
     99        return NULL;
     100    }
     101
    76102    pmFPAfile *bin2 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2");
     103    if (!bin2) {
     104        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BIN2"));
     105        psFree(options);
     106        return NULL;
     107    }
    77108
    78109    // bin1 and bin2 are used as carriers: input for byFPA1, byFPA2
     
    81112
    82113    pmFPAfile *jpg1 = pmFPAfileDefineOutput (config, byFPA1->fpa, "PPIMAGE.JPEG1");
     114    if (!jpg1) {
     115        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.JPEG1"));
     116        psFree(options);
     117        return NULL;
     118    }
    83119    pmFPAfile *jpg2 = pmFPAfileDefineOutput (config, byFPA2->fpa, "PPIMAGE.JPEG2");
     120    if (!jpg2) {
     121        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.JPEG2"));
     122        psFree(options);
     123        return NULL;
     124    }
    84125
    85126    // XXX we could potentially not define these pmFPAfiles if no output is requested...
Note: See TracChangeset for help on using the changeset viewer.