gnu-octave / octave-cfitsio

FITS file read and write for GNU Octave
https://gnu-octave.github.io/octave-cfitsio/
GNU General Public License v3.0
0 stars 0 forks source link

Error with uint8 image in createImg() #2

Closed Sarajevo67 closed 1 month ago

Sarajevo67 commented 4 months ago

After if in:

  if (bitpix == "byte_img" || bitpix == "uint8")
    bpp = BYTE_IMG;
  if (bitpix == "sbyte_img" || bitpix == "int8")
    bpp = SBYTE_IMG;
  else if (bitpix == "short_img" || bitpix == "int16")
    bpp = SHORT_IMG;
  else if (bitpix == "ushort_img" || bitpix == "uint16")
    bpp = USHORT_IMG;
  else if (bitpix == "long_img" || bitpix == "int32")
    bpp = LONG_IMG;
  else if (bitpix == "longlong_img" || bitpix == "int64")
    bpp = LONGLONG_IMG;
#ifdef ULONGLONG_IMG
  else if (bitpix == "ulonglong_img" || bitpix == "uint64")
    bpp = ULONGLONG_IMG;
#endif
  else if (bitpix == "float_img" || bitpix == "single")
    bpp = FLOAT_IMG;
  else if (bitpix == "double_img" || bitpix == "double")
    bpp = DOUBLE_IMG;
  else
    {
      error("Unknown bitpix '%s'", bitpix.c_str());
      return octave_value ();
    }

another if is issued (instead else if), which, in else statement' below, generate error for uint8: error: Unknown bitpix 'uint8' error: called from createImg at line 42 column 3

The same error is in insertImg()

lostbard commented 1 month ago

thanks for report - its been updated in the repo and will appear in the next release.