IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 28, 2015, 8:27:00 PM (11 years ago)
Author:
eugene
Message:

adding code for table compress/uncompress; image compress works (but is not quite compatible with cfitsio for some reason and byteswap is broken)

File:
1 edited

Legend:

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

    r23815 r38329  
    2626int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
    2727
     28static int pass = 0;
     29
    2830int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) {
    2931
     
    3638
    3739    // for GZIP data, I need to check for and remove the header on the first block:
    38     gfits_gz_stripheader ((unsigned char *)zdata, &Nzdata);
     40    // XXX maybe not anymore
     41    // gfits_gz_stripheader ((unsigned char *)zdata, &Nzdata);
     42
     43    if (pass == 0) {
     44      int i;
     45      for (i = 0; i < 32; i++) {
     46        fprintf (stderr, "0x%02hhx ", zdata[i]);
     47      }
     48      fprintf (stderr, "\n");
     49      pass = 1;
     50    }
    3951
    4052    // uncompress does not require us to know the expected number of pixel; it tells us the number
     53    // XXX shouldn't we validate the result : we think we know the size
    4154    status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);
    4255    if (status != Z_OK) {
     
    4760
    4861    // the resulting uncompressed data is byteswapped
    49     if (!gfits_byteswap_zdata (outdata, *Nout, out_pixsize)) return (FALSE);
     62    // if (!gfits_byteswap_zdata (outdata, *Nout, out_pixsize)) return (FALSE);
    5063
    5164    return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.