IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2015, 5:42:47 PM (11 years ago)
Author:
eugene
Message:

libfits compressed I/O seems to be generally working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_data.c

    r38362 r38366  
    2828# define ESCAPE(RET) { fprintf (stderr, "gzip error in %s @ %s:%d\n", __func__, __FILE__, __LINE__); return (RET); }
    2929
    30 int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) {
     30int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int Nout_alloc, int out_pixsize) {
    3131
    3232  int status;
    3333
    3434  // do not actually uncompress : this is used for testing
    35   if (!strcasecmp(cmptype, "NONE")) {
     35  if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_2")) {
    3636    memcpy (outdata, zdata, Nzdata);
     37    myAssert (*Nout == Nzdata, "invalid size");
    3738    *Nout = Nzdata / out_pixsize;
    3839    return (TRUE);
     
    4243    // unsigned long tNout = *Nout * out_pixsize;
    4344    // input value of *Nout is number of BYTES
    44     unsigned long tNout = *Nout;
     45    unsigned long tNout = Nout_alloc;
    4546
    4647    // for GZIP data, I need to check for and remove the header on the first block:
     
    5253    status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);
    5354    if (status != Z_OK) ESCAPE(FALSE);
     55    myAssert (*Nout == tNout, "uncompressed size mismatch");
    5456    *Nout = tNout / out_pixsize;
    5557    // output value of *Nout is number of PIXELS
Note: See TracChangeset for help on using the changeset viewer.