IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2015, 7:59:48 PM (11 years ago)
Author:
eugene
Message:

more work on compression : cfitsio assumes gzip, not zlib (I have made uncompress general )

File:
1 edited

Legend:

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

    r38339 r38340  
    249249  // size of a pixel in the output from the decompression routine
    250250  odata_pixsize = gfits_uncompressed_data_pixsize (cmptype, header[0].bitpix, optname, optvalue, Noptions);
    251   ALLOCATE (out, char, odata_pixsize*max_tile_size);
     251
     252  int Nout_alloc = odata_pixsize*max_tile_size;
     253  ALLOCATE (out, char, Nout_alloc);
    252254
    253255  off_t row;
     
    258260
    259261    // expected output size for this tile
    260     Nout = gfits_tile_size (matrix, otile, ztile);
     262    // Nout = gfits_tile_size (matrix, otile, ztile);
     263    Nout = Nout_alloc;
    261264
    262265    zdata = gfits_varlength_column_pointer (ftable, &zdef, row, &Nzdata);
     
    273276    // XXX the tile must not be > 2GB
    274277    if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) ESCAPE;
     278
     279    if (!strcasecmp(cmptype, "GZIP_1")) {
     280      if (!gfits_byteswap_zdata (out, Nout, odata_pixsize)) ESCAPE;
     281    }
    275282
    276283    // copy the uncompressed pixels into their correct locations           
     
    387394        SETUP_INSIZE (int, 4);
    388395        break;
     396      case 8:
     397        SETUP_INSIZE (double, 8);
     398        break;
    389399      default:
    390400        abort();
Note: See TracChangeset for help on using the changeset viewer.