Skip to content

Issue #3486: Port FITS plug-in to cfitsio library

Alx Sa requested to merge alxsa-fits-cfitsio-port into master

This is an in-progress patch to update FITS support in GIMP, per the guidance listed in issue 3486.

The main goal of this merge request is to port the plug-in to use the cfitsio library maintained by NASA (which is updated via external repositories) rather than the internal/unmaintained fitsrw library included in /file-fits/.

Current progress:

  • Use cfitsio API for loading images
    • Can now open all compressed FITS images linked in the issue report, and others found online
    • 8/16/32 bit, float/double precision
    • Grayscale and RGB
  • Open multi-image FITS file as layers, rather than separate images
  • Port load dialogue to GimpProcedureDialog API
  • Port the saving features to use cfitsio as well
    • Remove fitsrw files once this is done

Additional test images welcome! I'm especially interested in RGB FITS images that currently load in GIMP (before the port) to make sure there's no regressions.

Update: I stopped trying to special-case imports and just used gdouble for everything. Now 32 Bit images and RGB images load correctly! Note that GIMP currently only uses per-layer pixel min/max values to normalize the image. More advanced control over import levels is planned for future work.

Update: Okay, everything's ported now! There are future updates that can be done such as improved metadata load/export and compression options when exporting, but that will be for a future merge request. 😄

Edited by Alx Sa

Merge request reports