mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
plug-ins: Fix bug with RGB FITS export
Resolves #13842 fits_write_img () was incorrectly used, since we were writing one channel of RRR...GGG...BBB... data at a time. This patch switches to fits_write_pix (), and increments the first pixel's 3rd index after writing each channel so that the next channel is written from the correct starting point.
This commit is contained in:
@@ -889,12 +889,14 @@ export_fits (GFile *file,
|
||||
}
|
||||
else
|
||||
{
|
||||
glong fpixel[3] = {1, 1, 1};
|
||||
gdouble *rgb_data;
|
||||
gdouble *rgb_output;
|
||||
const Babl *rgb_format;
|
||||
const Babl *output_format = babl_format ("Y' double");
|
||||
const Babl *converted_format;
|
||||
|
||||
|
||||
rgb_format = (channelnum == 3) ? babl_format ("R'G'B' double") :
|
||||
babl_format ("R'G'B'A double");
|
||||
|
||||
@@ -943,12 +945,13 @@ export_fits (GFile *file,
|
||||
babl_process (babl_fish (output_format, converted_format),
|
||||
rgb_output, converted_output, nelements);
|
||||
|
||||
if (fits_write_img (fptr, export_type, 1, nelements,
|
||||
if (fits_write_pix (fptr, export_type, fpixel, nelements,
|
||||
converted_output, &status))
|
||||
{
|
||||
show_fits_errors (status);
|
||||
return FALSE;
|
||||
}
|
||||
fpixel[2]++;
|
||||
|
||||
g_free (converted_output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user