IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26989


Ignore:
Timestamp:
Feb 18, 2010, 12:37:08 PM (16 years ago)
Author:
Paul Price
Message:

Require min_num to be specified and >= 2. We can't make a stack with 1 input image, and the number of inputs is sufficiently important to force the user to think.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/stacktool.c

    r26984 r26989  
    158158    // these are used to build the HAVING restriction
    159159    PXOPT_COPY_S32(config->args, having, "-min_num", "num_warp", ">=");
     160    PXOPT_LOOKUP_S32(min_num,     config->args, "-min_new",  false, false);
     161    if (min_num < 2) {
     162        psError(PXTOOLS_ERR_CONFIG, true, "Require at least two inputs for a stack, but min_num = %d",
     163                min_num);
     164        psFree(where);
     165        psFree(having);
     166        return false;
     167    }
    160168
    161169    // other options applied outside of the WHERE
     
    168176
    169177    if (!psListLength(where->list)) {
     178        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    170179        psFree(where);
    171         psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
     180        psFree(having);
    172181        return false;
    173182    }
     
    176185    if (!select) {
    177186        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     187        psFree(where);
     188        psFree(having);
    178189        return false;
    179190    }
Note: See TracChangeset for help on using the changeset viewer.