Bug 555562 - GIMP should ask before applying working space profile

Get rid of the "configurable RGB working space profile".

Instead, turn GimpColorConfig's "rgb-profile" property into a
"Preferred RGB profile" thing that is only a hint and never used
without explicit user interaction. Present it next to the built-in
profile in the profile combo boxes and call it "Preferred" in the
prefs dialog and its tooltip.

Most importantly, don't use it as the image's profile when the image
is not tagged with a profile. Untagged images are now always in the
sRGB or linear RGB built-in color spaces.

This commit reduces the "Apply color profile" dialog on file import to
a simple "Convert to built-in RGB", but that dialog is about to be
moved to the core and improved anyway.
This commit is contained in:
Michael Natterer 2015-08-20 16:02:22 +02:00
parent 6bb117286b
commit 77dac3ea60
5 changed files with 55 additions and 73 deletions

View File

@ -1382,23 +1382,11 @@ gimp_image_color_managed_get_color_profile (GimpColorManaged *managed)
GimpColorProfile *profile;
profile = gimp_image_get_color_profile (image);
if (profile)
g_object_ref (profile);
if (! profile)
{
GimpColorConfig *config = image->gimp->config->color_management;
profile = gimp_image_get_builtin_color_profile (image);
profile = gimp_color_config_get_rgb_color_profile (config, NULL);
}
if (! profile)
{
profile = gimp_image_get_builtin_color_profile (image);
g_object_ref (profile);
}
return profile;
return g_object_ref (profile);
}
static void

View File

@ -276,10 +276,9 @@ color_profile_combo_box_new (ProfileDialog *dialog)
GtkWidget *combo;
GtkWidget *chooser;
gchar *history;
GimpColorProfile *profile;
gchar *label;
GFile *rgb_file = NULL;
GimpColorProfile *profile = NULL;
GError *error = NULL;
GError *error = NULL;
chooser = gimp_color_profile_chooser_dialog_new (_("Select destination profile"));
@ -287,11 +286,32 @@ color_profile_combo_box_new (ProfileDialog *dialog)
combo = gimp_color_profile_combo_box_new (chooser, history);
g_free (history);
profile = gimp_image_get_builtin_color_profile (dialog->image);
label = g_strdup_printf (_("Built-in RGB (%s)"),
gimp_color_profile_get_label (profile));
gimp_color_profile_combo_box_add_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
NULL, label);
g_free (label);
profile = gimp_color_config_get_rgb_color_profile (dialog->config, &error);
if (profile)
{
rgb_file = g_file_new_for_path (dialog->config->rgb_profile);
GFile *file = g_file_new_for_path (dialog->config->rgb_profile);
label = g_strdup_printf (_("Preferred RGB (%s)"),
gimp_color_profile_get_label (profile));
g_object_unref (profile);
gimp_color_profile_combo_box_add_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
file, label);
g_object_unref (file);
g_free (label);
}
else if (error)
{
@ -301,25 +321,6 @@ color_profile_combo_box_new (ProfileDialog *dialog)
g_clear_error (&error);
}
if (! profile)
{
profile = gimp_image_get_builtin_color_profile (dialog->image);
g_object_ref (profile);
}
label = g_strdup_printf (_("RGB workspace (%s)"),
gimp_color_profile_get_label (profile));
g_object_unref (profile);
gimp_color_profile_combo_box_add_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
rgb_file, label);
if (rgb_file)
g_object_unref (rgb_file);
g_free (label);
gimp_color_profile_combo_box_set_active_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
NULL, NULL);
@ -352,21 +353,8 @@ color_profile_dialog_response (GtkWidget *widget,
}
else
{
dest_profile = gimp_color_config_get_rgb_color_profile (dialog->config,
&error);
if (! dest_profile)
{
if (error)
{
success = FALSE;
}
else
{
dest_profile = gimp_image_get_builtin_color_profile (dialog->image);
g_object_ref (dest_profile);
}
}
dest_profile = gimp_image_get_builtin_color_profile (dialog->image);
g_object_ref (dest_profile);
}
if (success)

View File

@ -2374,7 +2374,7 @@ prefs_dialog_new (Gimp *gimp,
}
profiles[] =
{
{ N_("_RGB profile:"),
{ N_("Preferred _RGB profile:"),
N_("Select RGB Color Profile"), "rgb-profile" },
{ N_("_CMYK profile:"),
N_("Select CMYK Color Profile"), "cmyk-profile" },

View File

@ -52,38 +52,52 @@
#define COLOR_MANAGEMENT_MODE_BLURB \
_("Mode of operation for color management.")
#define DISPLAY_PROFILE_BLURB \
_("The color profile of your (primary) monitor.")
#define DISPLAY_PROFILE_FROM_GDK_BLURB \
_("When enabled, GIMP will try to use the display color profile from " \
"the windowing system. The configured monitor profile is then only " \
"used as a fallback.")
#define RGB_PROFILE_BLURB \
_("The default RGB working space color profile.")
_("The preferred RGB working space color profile. It will be offered " \
"next to the built-in RGB profile when a color profile can be chosen.")
#define CMYK_PROFILE_BLURB \
_("The CMYK color profile used to convert between RGB and CMYK.")
#define PRINTER_PROFILE_BLURB \
_("The color profile to use for soft proofing from your image's " \
"color space to some other color space, including " \
"color space to some other color space, including " \
"soft proofing to a printer or other output device profile. ")
#define DISPLAY_RENDERING_INTENT_BLURB \
_("How colors are converted from your image's color space to your display device. " \
"Relative colorimetric is usually the best choice. " \
"Unless you use a LUT monitor profile (most monitor profiles are matrix), " \
"choosing perceptual intent really gives you relative colorimetric." )
_("How colors are converted from your image's color space to your " \
"display device. Relative colorimetric is usually the best choice. " \
"Unless you use a LUT monitor profile (most monitor profiles are " \
"matrix), choosing perceptual intent really gives you relative " \
"colorimetric." )
#define DISPLAY_USE_BPC_BLURB \
_("Do use black point compensation (unless you know you have a reason not to). ")
#define SIMULATION_RENDERING_INTENT_BLURB \
_("Do use black point compensation (unless you know you have a reason " \
"not to). ")
#define SIMULATION_RENDERING_INTENT_BLURB \
_("How colors are converted from your image's color space to the " \
"output simulation device (usually your monitor). " \
"output simulation device (usually your monitor). " \
"Try them all and choose what looks the best. ")
#define SIMULATION_USE_BPC_BLURB \
#define SIMULATION_USE_BPC_BLURB \
_("Try with and without black point compensation "\
"and choose what looks best. ")
#define SIMULATION_GAMUT_CHECK_BLURB \
#define SIMULATION_GAMUT_CHECK_BLURB \
_("When enabled, the print simulation will mark colors " \
"which can not be represented in the target color space.")
#define OUT_OF_GAMUT_COLOR_BLURB \
#define OUT_OF_GAMUT_COLOR_BLURB \
_("The color to use for marking colors which are out of gamut.")

View File

@ -269,11 +269,6 @@ lcms_icc_apply (GimpColorConfig *config,
g_return_val_if_fail (GIMP_IS_COLOR_CONFIG (config), GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (image != -1, GIMP_PDB_CALLING_ERROR);
if (file)
g_object_ref (file);
else if (config->rgb_profile)
file = g_file_new_for_path (config->rgb_profile);
if (file)
{
GError *error = NULL;
@ -336,9 +331,6 @@ lcms_icc_apply (GimpColorConfig *config,
g_object_unref (src_profile);
g_object_unref (dest_profile);
if (file)
g_object_unref (file);
return status;
}