RF: Handle a couple of edge cases

Fix a couple of edge cases:

  • NewNifti will attempt to read from files that are already at EOF, but the bzip2 API will return an error code on attempts to do so. The bzip2Plugin::read function has been adjusted to check for EOF before attempting to read any more data.
  • NewNifti may create an empty file, and then close/re-open it for writing. To accommodate this, the guessFormat function has been adjusted so that, if the file is empty, it falls back to guessing the format from the file extension.

Merge request reports

Loading