- Timestamp:
- Jun 4, 2015, 5:42:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_data.c
r38362 r38366 28 28 # define ESCAPE(RET) { fprintf (stderr, "gzip error in %s @ %s:%d\n", __func__, __FILE__, __LINE__); return (RET); } 29 29 30 int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) {30 int 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) { 31 31 32 32 int status; 33 33 34 34 // do not actually uncompress : this is used for testing 35 if (!strcasecmp(cmptype, "NONE") ) {35 if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_2")) { 36 36 memcpy (outdata, zdata, Nzdata); 37 myAssert (*Nout == Nzdata, "invalid size"); 37 38 *Nout = Nzdata / out_pixsize; 38 39 return (TRUE); … … 42 43 // unsigned long tNout = *Nout * out_pixsize; 43 44 // input value of *Nout is number of BYTES 44 unsigned long tNout = *Nout;45 unsigned long tNout = Nout_alloc; 45 46 46 47 // for GZIP data, I need to check for and remove the header on the first block: … … 52 53 status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata); 53 54 if (status != Z_OK) ESCAPE(FALSE); 55 myAssert (*Nout == tNout, "uncompressed size mismatch"); 54 56 *Nout = tNout / out_pixsize; 55 57 // output value of *Nout is number of PIXELS
Note:
See TracChangeset
for help on using the changeset viewer.
