mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 17:59:37 +00:00
Issue #701 - Add the ability to embed the GIMP built-in sRGB profile...
...upon exporting an image Step 1: make it configurable just like "Export EXIF" etc. app, libgimp: add "export-color-profile" config option Add it to the preferences dialog, and pass it on to plug-ins in the GPConfig message. Add gimp_export_color_profile() to libgimp. Nothing uses this yet.
This commit is contained in:
parent
e0f46d1dc9
commit
8c9c091021
10 changed files with 70 additions and 19 deletions
|
@ -110,6 +110,7 @@ enum
|
||||||
PROP_IMPORT_PROMOTE_DITHER,
|
PROP_IMPORT_PROMOTE_DITHER,
|
||||||
PROP_IMPORT_ADD_ALPHA,
|
PROP_IMPORT_ADD_ALPHA,
|
||||||
PROP_IMPORT_RAW_PLUG_IN,
|
PROP_IMPORT_RAW_PLUG_IN,
|
||||||
|
PROP_EXPORT_COLOR_PROFILE,
|
||||||
PROP_EXPORT_METADATA_EXIF,
|
PROP_EXPORT_METADATA_EXIF,
|
||||||
PROP_EXPORT_METADATA_XMP,
|
PROP_EXPORT_METADATA_XMP,
|
||||||
PROP_EXPORT_METADATA_IPTC,
|
PROP_EXPORT_METADATA_IPTC,
|
||||||
|
@ -641,6 +642,13 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
|
||||||
GIMP_PARAM_STATIC_STRINGS |
|
GIMP_PARAM_STATIC_STRINGS |
|
||||||
GIMP_CONFIG_PARAM_RESTART);
|
GIMP_CONFIG_PARAM_RESTART);
|
||||||
|
|
||||||
|
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_COLOR_PROFILE,
|
||||||
|
"export-color-profile",
|
||||||
|
"Export Color Profile",
|
||||||
|
EXPORT_COLOR_PROFILE_BLURB,
|
||||||
|
TRUE,
|
||||||
|
GIMP_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_METADATA_EXIF,
|
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_METADATA_EXIF,
|
||||||
"export-metadata-exif",
|
"export-metadata-exif",
|
||||||
"Export Exif metadata",
|
"Export Exif metadata",
|
||||||
|
@ -967,6 +975,9 @@ gimp_core_config_set_property (GObject *object,
|
||||||
g_free (core_config->import_raw_plug_in);
|
g_free (core_config->import_raw_plug_in);
|
||||||
core_config->import_raw_plug_in = g_value_dup_string (value);
|
core_config->import_raw_plug_in = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_EXPORT_COLOR_PROFILE:
|
||||||
|
core_config->export_color_profile = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_EXPORT_METADATA_EXIF:
|
case PROP_EXPORT_METADATA_EXIF:
|
||||||
core_config->export_metadata_exif = g_value_get_boolean (value);
|
core_config->export_metadata_exif = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
@ -1166,6 +1177,9 @@ gimp_core_config_get_property (GObject *object,
|
||||||
case PROP_IMPORT_RAW_PLUG_IN:
|
case PROP_IMPORT_RAW_PLUG_IN:
|
||||||
g_value_set_string (value, core_config->import_raw_plug_in);
|
g_value_set_string (value, core_config->import_raw_plug_in);
|
||||||
break;
|
break;
|
||||||
|
case PROP_EXPORT_COLOR_PROFILE:
|
||||||
|
g_value_set_boolean (value, core_config->export_color_profile);
|
||||||
|
break;
|
||||||
case PROP_EXPORT_METADATA_EXIF:
|
case PROP_EXPORT_METADATA_EXIF:
|
||||||
g_value_set_boolean (value, core_config->export_metadata_exif);
|
g_value_set_boolean (value, core_config->export_metadata_exif);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -95,6 +95,7 @@ struct _GimpCoreConfig
|
||||||
gboolean import_promote_dither;
|
gboolean import_promote_dither;
|
||||||
gboolean import_add_alpha;
|
gboolean import_add_alpha;
|
||||||
gchar *import_raw_plug_in;
|
gchar *import_raw_plug_in;
|
||||||
|
gboolean export_color_profile;
|
||||||
gboolean export_metadata_exif;
|
gboolean export_metadata_exif;
|
||||||
gboolean export_metadata_xmp;
|
gboolean export_metadata_xmp;
|
||||||
gboolean export_metadata_iptc;
|
gboolean export_metadata_iptc;
|
||||||
|
|
|
@ -204,6 +204,9 @@ _("Add an alpha channel to all layers of imported images.")
|
||||||
#define IMPORT_RAW_PLUG_IN_BLURB \
|
#define IMPORT_RAW_PLUG_IN_BLURB \
|
||||||
_("Which plug-in to use for importing raw digital camera files.")
|
_("Which plug-in to use for importing raw digital camera files.")
|
||||||
|
|
||||||
|
#define EXPORT_COLOR_PROFILE_BLURB \
|
||||||
|
_("Export the image's color profile by default.")
|
||||||
|
|
||||||
#define EXPORT_METADATA_EXIF_BLURB \
|
#define EXPORT_METADATA_EXIF_BLURB \
|
||||||
_("Export Exif metadata by default.")
|
_("Export Exif metadata by default.")
|
||||||
|
|
||||||
|
|
|
@ -1476,6 +1476,9 @@ prefs_dialog_new (Gimp *gimp,
|
||||||
vbox2 = prefs_frame_new (_("Export Policies"),
|
vbox2 = prefs_frame_new (_("Export Policies"),
|
||||||
GTK_CONTAINER (vbox), FALSE);
|
GTK_CONTAINER (vbox), FALSE);
|
||||||
|
|
||||||
|
button = prefs_check_button_add (object, "export-color-profile",
|
||||||
|
_("Export the image's color profile by default"),
|
||||||
|
GTK_BOX (vbox2));
|
||||||
button = prefs_check_button_add (object, "export-metadata-exif",
|
button = prefs_check_button_add (object, "export-metadata-exif",
|
||||||
_("Export Exif metadata by default when available"),
|
_("Export Exif metadata by default when available"),
|
||||||
GTK_BOX (vbox2));
|
GTK_BOX (vbox2));
|
||||||
|
|
|
@ -207,6 +207,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager,
|
||||||
gui_config->show_help_button);
|
gui_config->show_help_button);
|
||||||
config.use_cpu_accel = manager->gimp->use_cpu_accel;
|
config.use_cpu_accel = manager->gimp->use_cpu_accel;
|
||||||
config.use_opencl = gegl_config->use_opencl;
|
config.use_opencl = gegl_config->use_opencl;
|
||||||
|
config.export_profile = core_config->export_color_profile;
|
||||||
config.export_exif = core_config->export_metadata_exif;
|
config.export_exif = core_config->export_metadata_exif;
|
||||||
config.export_xmp = core_config->export_metadata_xmp;
|
config.export_xmp = core_config->export_metadata_xmp;
|
||||||
config.export_iptc = core_config->export_metadata_iptc;
|
config.export_iptc = core_config->export_metadata_iptc;
|
||||||
|
|
|
@ -215,6 +215,7 @@ static gint _shm_ID = -1;
|
||||||
static guchar *_shm_addr = NULL;
|
static guchar *_shm_addr = NULL;
|
||||||
static const gdouble _gamma_val = 2.2;
|
static const gdouble _gamma_val = 2.2;
|
||||||
static gboolean _show_help_button = TRUE;
|
static gboolean _show_help_button = TRUE;
|
||||||
|
static gboolean _export_profile = FALSE;
|
||||||
static gboolean _export_exif = FALSE;
|
static gboolean _export_exif = FALSE;
|
||||||
static gboolean _export_xmp = FALSE;
|
static gboolean _export_xmp = FALSE;
|
||||||
static gboolean _export_iptc = FALSE;
|
static gboolean _export_iptc = FALSE;
|
||||||
|
@ -1416,6 +1417,22 @@ gimp_show_help_button (void)
|
||||||
return _show_help_button;
|
return _show_help_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_export_color_profile:
|
||||||
|
*
|
||||||
|
* Returns whether file plug-ins should default to exporting the
|
||||||
|
* image's color profile.
|
||||||
|
*
|
||||||
|
* Return value: TRUE if preferences are set to export the color profile.
|
||||||
|
*
|
||||||
|
* Since: 2.10.4
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
gimp_export_color_profile (void)
|
||||||
|
{
|
||||||
|
return _export_profile;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_export_exif:
|
* gimp_export_exif:
|
||||||
*
|
*
|
||||||
|
@ -2155,6 +2172,7 @@ gimp_config (GPConfig *config)
|
||||||
_check_size = config->check_size;
|
_check_size = config->check_size;
|
||||||
_check_type = config->check_type;
|
_check_type = config->check_type;
|
||||||
_show_help_button = config->show_help_button ? TRUE : FALSE;
|
_show_help_button = config->show_help_button ? TRUE : FALSE;
|
||||||
|
_export_profile = config->export_profile ? TRUE : FALSE;
|
||||||
_export_exif = config->export_exif ? TRUE : FALSE;
|
_export_exif = config->export_exif ? TRUE : FALSE;
|
||||||
_export_xmp = config->export_xmp ? TRUE : FALSE;
|
_export_xmp = config->export_xmp ? TRUE : FALSE;
|
||||||
_export_iptc = config->export_iptc ? TRUE : FALSE;
|
_export_iptc = config->export_iptc ? TRUE : FALSE;
|
||||||
|
|
|
@ -253,6 +253,7 @@ EXPORTS
|
||||||
gimp_enums_init
|
gimp_enums_init
|
||||||
gimp_eraser
|
gimp_eraser
|
||||||
gimp_eraser_default
|
gimp_eraser_default
|
||||||
|
gimp_export_color_profile
|
||||||
gimp_export_exif
|
gimp_export_exif
|
||||||
gimp_export_iptc
|
gimp_export_iptc
|
||||||
gimp_export_xmp
|
gimp_export_xmp
|
||||||
|
|
|
@ -320,6 +320,7 @@ gint gimp_shm_ID (void) G_GNUC_CONST;
|
||||||
guchar * gimp_shm_addr (void) G_GNUC_CONST;
|
guchar * gimp_shm_addr (void) G_GNUC_CONST;
|
||||||
gdouble gimp_gamma (void) G_GNUC_CONST;
|
gdouble gimp_gamma (void) G_GNUC_CONST;
|
||||||
gboolean gimp_show_help_button (void) G_GNUC_CONST;
|
gboolean gimp_show_help_button (void) G_GNUC_CONST;
|
||||||
|
gboolean gimp_export_color_profile (void) G_GNUC_CONST;
|
||||||
gboolean gimp_export_exif (void) G_GNUC_CONST;
|
gboolean gimp_export_exif (void) G_GNUC_CONST;
|
||||||
gboolean gimp_export_xmp (void) G_GNUC_CONST;
|
gboolean gimp_export_xmp (void) G_GNUC_CONST;
|
||||||
gboolean gimp_export_iptc (void) G_GNUC_CONST;
|
gboolean gimp_export_iptc (void) G_GNUC_CONST;
|
||||||
|
|
|
@ -500,6 +500,10 @@ _gp_config_read (GIOChannel *channel,
|
||||||
(guint8 *) &config->use_opencl, 1,
|
(guint8 *) &config->use_opencl, 1,
|
||||||
user_data))
|
user_data))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
if (! _gimp_wire_read_int8 (channel,
|
||||||
|
(guint8 *) &config->export_profile, 1,
|
||||||
|
user_data))
|
||||||
|
goto cleanup;
|
||||||
if (! _gimp_wire_read_int8 (channel,
|
if (! _gimp_wire_read_int8 (channel,
|
||||||
(guint8 *) &config->export_exif, 1,
|
(guint8 *) &config->export_exif, 1,
|
||||||
user_data))
|
user_data))
|
||||||
|
@ -584,6 +588,10 @@ _gp_config_write (GIOChannel *channel,
|
||||||
(const guint8 *) &config->use_opencl, 1,
|
(const guint8 *) &config->use_opencl, 1,
|
||||||
user_data))
|
user_data))
|
||||||
return;
|
return;
|
||||||
|
if (! _gimp_wire_write_int8 (channel,
|
||||||
|
(const guint8 *) &config->export_profile, 1,
|
||||||
|
user_data))
|
||||||
|
return;
|
||||||
if (! _gimp_wire_write_int8 (channel,
|
if (! _gimp_wire_write_int8 (channel,
|
||||||
(const guint8 *) &config->export_exif, 1,
|
(const guint8 *) &config->export_exif, 1,
|
||||||
user_data))
|
user_data))
|
||||||
|
|
|
@ -26,7 +26,7 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
/* Increment every time the protocol changes
|
/* Increment every time the protocol changes
|
||||||
*/
|
*/
|
||||||
#define GIMP_PROTOCOL_VERSION 0x0100
|
#define GIMP_PROTOCOL_VERSION 0x0101
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -69,6 +69,7 @@ struct _GPConfig
|
||||||
gint8 show_help_button;
|
gint8 show_help_button;
|
||||||
gint8 use_cpu_accel;
|
gint8 use_cpu_accel;
|
||||||
gint8 use_opencl;
|
gint8 use_opencl;
|
||||||
|
gint8 export_profile;
|
||||||
gint8 export_exif;
|
gint8 export_exif;
|
||||||
gint8 export_xmp;
|
gint8 export_xmp;
|
||||||
gint8 export_iptc;
|
gint8 export_iptc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue