diff --git a/element_interface/prairie_view_loader.py b/element_interface/prairie_view_loader.py index 97a0efa..6f701ae 100644 --- a/element_interface/prairie_view_loader.py +++ b/element_interface/prairie_view_loader.py @@ -180,6 +180,10 @@ def write_single_bigtiff( "'fps'": self.meta["frame_rate"], }, ) + # additional safeguard to close the file and delete the object + # in the attempt to prevent error: `not a TIFF file b''` + tffl.close() + del tffl except Exception as e: raise Exception(f"Error in processing tiff file {input_file}: {e}")