Commit 7ed93452 authored by Michael Natterer's avatar Michael Natterer

Issue #1297 - Unhide the items hidden in the Advanced drop-down file...

...export dialogs

Remove the "Advanced" expander from the PNG export GUI and generally
clean up the dialog layout.

Issue #701: Add a "Save color profile" toggle and always honor it.
parent 540cfa96
......@@ -104,6 +104,7 @@ typedef struct
gboolean save_xmp;
gboolean save_iptc;
gboolean save_thumbnail;
gboolean save_profile;
PngExportFormat export_format;
}
PngSaveVals;
......@@ -126,6 +127,7 @@ typedef struct
GtkWidget *save_xmp;
GtkWidget *save_iptc;
GtkWidget *save_thumbnail;
GtkWidget *save_profile;
}
PngSaveGui;
......@@ -551,6 +553,7 @@ run (const gchar *name,
pngvals.save_xmp = (metadata_flags & GIMP_METADATA_SAVE_XMP) != 0;
pngvals.save_iptc = (metadata_flags & GIMP_METADATA_SAVE_IPTC) != 0;
pngvals.save_thumbnail = (metadata_flags & GIMP_METADATA_SAVE_THUMBNAIL) != 0;
pngvals.save_profile = gimp_export_color_profile ();
/* Override preferences from PNG export defaults (if saved). */
load_parasite ();
......@@ -1495,7 +1498,8 @@ save_image (const gchar *filename,
png_textp text = NULL;
#if defined(PNG_iCCP_SUPPORTED)
profile = gimp_image_get_color_profile (orig_image_ID);
if (pngvals.save_profile)
profile = gimp_image_get_effective_color_profile (orig_image_ID);
#endif
switch (gimp_image_get_precision (image_ID))
......@@ -2386,18 +2390,25 @@ save_dialog (gint32 image_ID,
pg.time = toggle_button_init (builder, "save-creation-time",
pngvals.time,
&pngvals.time);
pg.save_exif = toggle_button_init (builder, "sv_exif",
pg.save_exif = toggle_button_init (builder, "save-exif",
pngvals.save_exif,
&pngvals.save_exif);
pg.save_xmp = toggle_button_init (builder, "sv_xmp",
pg.save_xmp = toggle_button_init (builder, "save-xmp",
pngvals.save_xmp,
&pngvals.save_xmp);
pg.save_iptc = toggle_button_init (builder, "sv_iptc",
pg.save_iptc = toggle_button_init (builder, "save-iptc",
pngvals.save_iptc,
&pngvals.save_iptc);
pg.save_thumbnail = toggle_button_init (builder, "sv_thumbnail",
pg.save_thumbnail = toggle_button_init (builder, "save-thumbnail",
pngvals.save_thumbnail,
&pngvals.save_thumbnail);
pg.save_profile = toggle_button_init (builder, "save-color-profile",
pngvals.save_profile,
&pngvals.save_profile);
#if !defined(PNG_iCCP_SUPPORTED)
gtk_widget_hide (pg.save_profile);
#endif
/* Comment toggle */
parasite = gimp_image_get_parasite (image_ID, "gimp-comment");
......@@ -2498,7 +2509,7 @@ load_parasite (void)
gimp_parasite_free (parasite);
num_fields = sscanf (def_str, "%d %d %d %d %d %d %d %d %d %d %d %d %d",
num_fields = sscanf (def_str, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d",
&tmpvals.interlaced,
&tmpvals.bkgd,
&tmpvals.gama,
......@@ -2511,11 +2522,12 @@ load_parasite (void)
&tmpvals.save_exif,
&tmpvals.save_xmp,
&tmpvals.save_iptc,
&tmpvals.save_thumbnail);
&tmpvals.save_thumbnail,
&tmpvals.save_profile);
g_free (def_str);
if (num_fields == 9 || num_fields == 13)
if (num_fields == 9 || num_fields == 13 || num_fields == 14)
pngvals = tmpvals;
}
}
......@@ -2526,7 +2538,7 @@ save_parasite (void)
GimpParasite *parasite;
gchar *def_str;
def_str = g_strdup_printf ("%d %d %d %d %d %d %d %d %d %d %d %d %d",
def_str = g_strdup_printf ("%d %d %d %d %d %d %d %d %d %d %d %d %d %d",
pngvals.interlaced,
pngvals.bkgd,
pngvals.gama,
......@@ -2539,7 +2551,8 @@ save_parasite (void)
pngvals.save_exif,
pngvals.save_xmp,
pngvals.save_iptc,
pngvals.save_thumbnail);
pngvals.save_thumbnail,
pngvals.save_profile);
parasite = gimp_parasite_new (PNG_DEFAULTS_PARASITE,
GIMP_PARASITE_PERSISTENT,
......@@ -2575,6 +2588,7 @@ load_gui_defaults (PngSaveGui *pg)
SET_ACTIVE (save_xmp);
SET_ACTIVE (save_iptc);
SET_ACTIVE (save_thumbnail);
SET_ACTIVE (save_profile);
#undef SET_ACTIVE
......
This diff is collapsed.
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