Commit d57eafd1 authored by Jehan's avatar Jehan

plug-ins: gAMA chunk export is now a redundant option.

Now when a gAMA chunk is set on an imported PNG (and if there is no
profile attached), an equivalent profile is created out of the gAMA
chunk. So the displayed image looks like it is supposed to.
On export, the generated profile should simply be saved together in the
PNG file. If not, the sRGB chunk is set anyway (and also an equivalent
gAMA/cHRM as recommended in the specs).

So basically we now have a proper support of the gAMA chunk, from import
to export, and display within GIMP takes this metadata into account
appropriately (in the shape of a generated equivalent profile).
Therefore it looks to me keeping the option is redundant. It is even
confusing (because it's actually hard to understand exactly what this
data is about, even our documentation about this metadata seems to be
wrong) hence possibly dangerous if someone thinks it is important,
checks the box, which would override other data or simply create
irrelevant or contradictory metadata.

So let's just remove this option. Development releases are the right
places anyway for people to notice this change and come to us if we
missed some usage regarding this option.
See also #5363.
parent 72af40b4
Pipeline #251256 passed with stages
in 61 minutes and 57 seconds
......@@ -245,12 +245,6 @@ png_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_ARG_BOOLEAN (procedure, "gama",
"Save _gamma",
"Write gAMA chunk (PNG metadata)",
GIMP_PROC_ARG_BOOLEAN (procedure, "offs",
"Save layer o_ffset",
"Write oFFs chunk (PNG metadata)",
......@@ -958,23 +952,6 @@ load_image (GFile *file,
* due to a bug in libpng-1.0.6, see png-implement for details
if (png_get_valid (pp, info, PNG_INFO_gAMA))
GimpParasite *parasite;
gdouble gamma;
png_get_gAMA (pp, info, &gamma);
g_ascii_dtostr (buf, sizeof (buf), gamma);
parasite = gimp_parasite_new ("gamma",
strlen (buf) + 1, buf);
gimp_image_attach_parasite ((GimpImage *) image, parasite);
gimp_parasite_free (parasite);
if (png_get_valid (pp, info, PNG_INFO_oFFs))
gint offset_x = png_get_x_offset_pixels (pp, info);
......@@ -1345,7 +1322,6 @@ save_image (GFile *file,
gboolean save_interlaced;
gboolean save_bkgd;
gboolean save_gama;
gboolean save_offs;
gboolean save_phys;
gboolean save_time;
......@@ -1365,7 +1341,6 @@ save_image (GFile *file,
g_object_get (config,
"interlaced", &save_interlaced,
"bkgd", &save_bkgd,
"gama", &save_gama,
"offs", &save_offs,
"phys", &save_phys,
"time", &save_time,
......@@ -1755,21 +1730,6 @@ save_image (GFile *file,
png_set_bKGD (pp, info, &background);
if (save_gama)
GimpParasite *parasite;
gdouble gamma = 1.0 / DEFAULT_GAMMA;
parasite = gimp_image_get_parasite (orig_image, "gamma");
if (parasite)
gamma = g_ascii_strtod (gimp_parasite_data (parasite), NULL);
gimp_parasite_free (parasite);
png_set_gAMA (pp, info, gamma);
if (save_offs)
gimp_drawable_offsets (drawable, &offx, &offy);
......@@ -2334,7 +2294,6 @@ save_dialog (GimpImage *image,
gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "bkgd");
gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "gama");
gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "offs");
gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "phys");
gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "time");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment