diff --git a/stim/envi/envi.h b/stim/envi/envi.h index 305540f..ff73a1c 100644 --- a/stim/envi/envi.h +++ b/stim/envi/envi.h @@ -61,6 +61,11 @@ class envi{ public: + /// Default constructor + envi(){ + file = NULL; //set the file pointer to NULL + } + envi_header header; void* malloc_spectrum(){ @@ -979,12 +984,13 @@ public: } /// Closes the ENVI file. - bool close(){ + void close(){ + if(file == NULL) return; if(header.interleave == envi_header::BSQ){ if(header.data_type ==envi_header::float32) - return ((bsq*)file)->close(); + ((bsq*)file)->close(); else if(header.data_type == envi_header::float64) - return ((bsq*)file)->close(); + ((bsq*)file)->close(); else{ std::cout<<"ERROR: unidentified data type"<*)file)->close(); + ((bil*)file)->close(); else if(header.data_type == envi_header::float64) - return ((bil*)file)->close(); + ((bil*)file)->close(); else{ std::cout<<"ERROR: unidentified data type"<*)file)->close(); + ((bip*)file)->close(); else if(header.data_type == envi_header::float64) - return ((bip*)file)->close(); + ((bip*)file)->close(); else{ std::cout<<"ERROR: unidentified data type"<