plug-ins: Match RGB FITS orientation to SiriL

Switching to the cfitsio library's fits_read_img () function in 03ea666f 
caused RGB FITS images to be read in upside down per SiriL developers and
NASA standards (odd, since cfitsio is maintained by NASA). This flips them back.
This commit is contained in:
Alx Sa 2023-06-30 15:11:46 +00:00
parent 71fa32424c
commit 3cf5a587ce
1 changed files with 11 additions and 0 deletions

View File

@ -605,6 +605,17 @@ load_image (GFile *file,
show_fits_errors (status);
g_object_unref (buffer);
if (hdu.naxisn[2] && hdu.naxisn[2] == 3)
{
/* Per SiriL developers, FITS images should be loaded from the
* bottom up. fits_read_img () loads them from top down, so we
* should flip the layer. */
gimp_item_transform_flip_simple (GIMP_ITEM (layer),
GIMP_ORIENTATION_VERTICAL,
TRUE, -1.0);
}
if (pixels)
g_free (pixels);