Changeset 23724 for trunk/Ohana/src/libfits/matrix/F_uncompress_data.c
- Timestamp:
- Apr 7, 2009, 12:45:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/matrix/F_uncompress_data.c
r18272 r23724 22 22 int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix); 23 23 24 /* functions defined in gzip.c */ 25 int gfits_gz_stripheader (unsigned char *data, int *ndata); 26 int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); 27 24 28 int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) { 25 29 … … 30 34 if (!strcasecmp(cmptype, "GZIP_1")) { 31 35 unsigned long tNout = *Nout * out_pixsize; 36 37 // for GZIP data, I need to check for and remove the header on the first block: 38 gfits_gz_stripheader ((unsigned char *)zdata, &Nzdata); 39 32 40 // uncompress does not require us to know the expected number of pixel; it tells us the number 33 status = uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);41 status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata); 34 42 if (status != Z_OK) { 35 43 fprintf (stderr, "error in uncompress (GZIP)\n"); 36 44 return (FALSE); 37 45 } 38 *Nout = tNout; 46 47 // the resulting uncompressed data is byteswapped 48 if (!gfits_byteswap_zdata (outdata, tNout, out_pixsize)) return (FALSE); 49 50 *Nout = tNout / out_pixsize; 39 51 return (TRUE); 40 52 }
Note:
See TracChangeset
for help on using the changeset viewer.
