2015-08-23 16:51:31 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* color-profile-import-dialog.h
|
|
|
|
* Copyright (C) 2015 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
|
|
|
* Partly based on the lcms plug-in
|
|
|
|
* Copyright (C) 2006, 2007 Sven Neumann <sven@gimp.org>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2015-08-23 16:51:31 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gegl.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2020-09-24 22:27:34 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2015-08-23 16:51:31 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "dialogs-types.h"
|
|
|
|
|
2020-09-24 22:27:34 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
|
|
|
|
2015-08-23 16:51:31 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimpimage-color-profile.h"
|
|
|
|
|
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
#include "widgets/gimpviewabledialog.h"
|
|
|
|
#include "widgets/gimpwidgets-constructors.h"
|
|
|
|
|
|
|
|
#include "color-profile-import-dialog.h"
|
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
|
|
|
GimpColorProfilePolicy
|
2016-06-06 04:36:52 +08:00
|
|
|
color_profile_import_dialog_run (GimpImage *image,
|
|
|
|
GimpContext *context,
|
|
|
|
GtkWidget *parent,
|
|
|
|
GimpColorProfile **dest_profile,
|
|
|
|
GimpColorRenderingIntent *intent,
|
|
|
|
gboolean *bpc,
|
|
|
|
gboolean *dont_ask)
|
2015-08-23 16:51:31 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *main_vbox;
|
2016-06-06 04:36:52 +08:00
|
|
|
GtkWidget *vbox;
|
2020-09-24 22:27:34 +08:00
|
|
|
GtkWidget *stack;
|
|
|
|
GtkWidget *switcher;
|
2015-08-23 16:51:31 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *label;
|
2016-06-06 04:36:52 +08:00
|
|
|
GtkWidget *intent_combo;
|
|
|
|
GtkWidget *bpc_toggle;
|
|
|
|
GtkWidget *dont_ask_toggle;
|
2015-08-23 16:51:31 +08:00
|
|
|
GimpColorProfile *src_profile;
|
2020-09-24 22:27:34 +08:00
|
|
|
GimpColorProfile *pref_profile = NULL;
|
2015-08-23 16:51:31 +08:00
|
|
|
GimpColorProfilePolicy policy;
|
2015-12-15 06:23:25 +08:00
|
|
|
const gchar *frame_title;
|
2015-08-23 16:51:31 +08:00
|
|
|
gchar *text;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_COLOR_PROFILE_POLICY_KEEP);
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_COLOR_PROFILE_POLICY_KEEP);
|
|
|
|
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent),
|
|
|
|
GIMP_COLOR_PROFILE_POLICY_KEEP);
|
|
|
|
g_return_val_if_fail (dest_profile != NULL, GIMP_COLOR_PROFILE_POLICY_KEEP);
|
|
|
|
|
|
|
|
src_profile = gimp_image_get_color_profile (image);
|
|
|
|
*dest_profile = gimp_image_get_builtin_color_profile (image);
|
|
|
|
|
2015-12-15 06:23:25 +08:00
|
|
|
if (gimp_image_get_base_type (image) == GIMP_GRAY)
|
|
|
|
{
|
2019-06-21 18:34:56 +08:00
|
|
|
frame_title = _("Convert the image to the built-in grayscale color profile?");
|
2020-09-24 22:27:34 +08:00
|
|
|
|
|
|
|
pref_profile = gimp_color_config_get_gray_color_profile (image->gimp->config->color_management, NULL);
|
|
|
|
if (pref_profile && gimp_color_profile_is_equal (pref_profile, *dest_profile))
|
|
|
|
g_clear_object (&pref_profile);
|
2015-12-15 06:23:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-21 18:34:56 +08:00
|
|
|
frame_title = _("Convert the image to the built-in sRGB color profile?");
|
2020-09-24 22:27:34 +08:00
|
|
|
|
|
|
|
pref_profile = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management, NULL);
|
|
|
|
if (pref_profile && gimp_color_profile_is_equal (pref_profile, *dest_profile))
|
|
|
|
g_clear_object (&pref_profile);
|
2015-12-15 06:23:25 +08:00
|
|
|
}
|
|
|
|
|
2015-08-23 16:51:31 +08:00
|
|
|
dialog =
|
2020-05-02 07:42:04 +08:00
|
|
|
gimp_viewable_dialog_new (g_list_prepend (NULL, image), context,
|
Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.
Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).
I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.
On the other hand (and that's why I was hesitating):
* "Keep" is also what happens when we hit "Esc" so some might complain that
there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
as easy as Esc or Enter). Basically it makes the "Convert" option always a
much more explicit choice (yet it is likely for the best for people who care
about their colors).
* There might have been many people who would just use the default (Convert
until now) without thinking too much of what was asked, and that was working
good because they would just publish on the web or similar basic usage. If
they continue just accepting with Enter without reading and understanding what
is asked, now they could publish images with a color profile (and we know it
doesn't always work perfectly on the web).
In other words, it might be the best default for professional usage now, yet
it requires to understand a bit what you are doing.
It's really a hard call!
2022-11-01 23:21:24 +08:00
|
|
|
_("Keep the Embedded Working Space?"),
|
2015-08-23 16:51:31 +08:00
|
|
|
"gimp-image-color-profile-import",
|
2023-05-25 16:26:43 +08:00
|
|
|
"gimp-prefs-color-management",
|
Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.
Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).
I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.
On the other hand (and that's why I was hesitating):
* "Keep" is also what happens when we hit "Esc" so some might complain that
there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
as easy as Esc or Enter). Basically it makes the "Convert" option always a
much more explicit choice (yet it is likely for the best for people who care
about their colors).
* There might have been many people who would just use the default (Convert
until now) without thinking too much of what was asked, and that was working
good because they would just publish on the web or similar basic usage. If
they continue just accepting with Enter without reading and understanding what
is asked, now they could publish images with a color profile (and we know it
doesn't always work perfectly on the web).
In other words, it might be the best default for professional usage now, yet
it requires to understand a bit what you are doing.
It's really a hard call!
2022-11-01 23:21:24 +08:00
|
|
|
_("Keep the image's color profile"),
|
2015-08-23 16:51:31 +08:00
|
|
|
parent,
|
|
|
|
gimp_standard_help_func,
|
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_IMPORT,
|
|
|
|
|
Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.
Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).
I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.
On the other hand (and that's why I was hesitating):
* "Keep" is also what happens when we hit "Esc" so some might complain that
there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
as easy as Esc or Enter). Basically it makes the "Convert" option always a
much more explicit choice (yet it is likely for the best for people who care
about their colors).
* There might have been many people who would just use the default (Convert
until now) without thinking too much of what was asked, and that was working
good because they would just publish on the web or similar basic usage. If
they continue just accepting with Enter without reading and understanding what
is asked, now they could publish images with a color profile (and we know it
doesn't always work perfectly on the web).
In other words, it might be the best default for professional usage now, yet
it requires to understand a bit what you are doing.
It's really a hard call!
2022-11-01 23:21:24 +08:00
|
|
|
_("_Keep"), GTK_RESPONSE_YES,
|
|
|
|
_("_Convert"), GTK_RESPONSE_NO,
|
2015-08-23 16:51:31 +08:00
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.
Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).
I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.
On the other hand (and that's why I was hesitating):
* "Keep" is also what happens when we hit "Esc" so some might complain that
there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
as easy as Esc or Enter). Basically it makes the "Convert" option always a
much more explicit choice (yet it is likely for the best for people who care
about their colors).
* There might have been many people who would just use the default (Convert
until now) without thinking too much of what was asked, and that was working
good because they would just publish on the web or similar basic usage. If
they continue just accepting with Enter without reading and understanding what
is asked, now they could publish images with a color profile (and we know it
doesn't always work perfectly on the web).
In other words, it might be the best default for professional usage now, yet
it requires to understand a bit what you are doing.
It's really a hard call!
2022-11-01 23:21:24 +08:00
|
|
|
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
|
2015-08-23 16:51:31 +08:00
|
|
|
|
|
|
|
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
|
|
|
|
|
|
|
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
|
|
|
|
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
|
|
|
|
main_vbox, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (main_vbox);
|
|
|
|
|
|
|
|
text = g_strdup_printf (_("The image '%s' has an embedded color profile"),
|
|
|
|
gimp_image_get_display_name (image));
|
|
|
|
frame = gimp_frame_new (text);
|
|
|
|
g_free (text);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
label = gimp_color_profile_label_new (src_profile);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), label);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2020-09-24 22:27:34 +08:00
|
|
|
switcher = gtk_stack_switcher_new ();
|
|
|
|
|
|
|
|
stack = gtk_stack_new ();
|
|
|
|
gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), GTK_STACK (stack));
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), stack, FALSE, FALSE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), switcher, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (stack);
|
|
|
|
|
2015-12-15 06:23:25 +08:00
|
|
|
frame = gimp_frame_new (frame_title);
|
2023-05-25 22:55:08 +08:00
|
|
|
gtk_stack_add_titled (GTK_STACK (stack), frame, "builtin",
|
|
|
|
_("Built-in Profile"));
|
2015-08-23 16:51:31 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
label = gimp_color_profile_label_new (*dest_profile);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), label);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2020-09-24 22:27:34 +08:00
|
|
|
if (pref_profile)
|
|
|
|
{
|
|
|
|
if (gimp_image_get_base_type (image) == GIMP_GRAY)
|
|
|
|
frame_title = _("Convert the image to the preferred grayscale color profile?");
|
|
|
|
else
|
2020-12-20 04:42:35 +08:00
|
|
|
frame_title = _("Convert the image to the preferred RGB color profile?");
|
2020-09-24 22:27:34 +08:00
|
|
|
|
|
|
|
frame = gimp_frame_new (frame_title);
|
2023-05-25 22:55:08 +08:00
|
|
|
gtk_stack_add_titled (GTK_STACK (stack), frame, "preferred",
|
|
|
|
_("Preferred Profile"));
|
2020-09-24 22:27:34 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
label = gimp_color_profile_label_new (pref_profile);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), label);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
gtk_widget_show (switcher);
|
|
|
|
gtk_stack_set_visible_child_name (GTK_STACK (stack), "preferred");
|
|
|
|
}
|
|
|
|
|
2016-06-06 04:36:52 +08:00
|
|
|
if (intent && bpc)
|
|
|
|
{
|
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
vbox = main_vbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (intent)
|
|
|
|
{
|
|
|
|
GtkWidget *hbox;
|
|
|
|
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
label = gtk_label_new_with_mnemonic (_("_Rendering Intent:"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
intent_combo = gimp_enum_combo_box_new (GIMP_TYPE_COLOR_RENDERING_INTENT);
|
|
|
|
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (intent_combo),
|
|
|
|
*intent);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), intent_combo, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (intent_combo);
|
|
|
|
|
|
|
|
gtk_label_set_mnemonic_widget (GTK_LABEL (label), intent_combo);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bpc)
|
|
|
|
{
|
|
|
|
bpc_toggle =
|
|
|
|
gtk_check_button_new_with_mnemonic (_("_Black Point Compensation"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bpc_toggle), *bpc);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), bpc_toggle, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (bpc_toggle);
|
|
|
|
}
|
|
|
|
|
2015-08-23 16:51:31 +08:00
|
|
|
if (dont_ask)
|
|
|
|
{
|
2016-06-06 04:36:52 +08:00
|
|
|
dont_ask_toggle =
|
|
|
|
gtk_check_button_new_with_mnemonic (_("_Don't ask me again"));
|
2022-11-02 00:36:45 +08:00
|
|
|
gtk_widget_set_tooltip_text (dont_ask_toggle,
|
|
|
|
_("Your choice can later be edited in Preferences > Color Management"));
|
2016-06-06 04:36:52 +08:00
|
|
|
gtk_box_pack_end (GTK_BOX (main_vbox), dont_ask_toggle, FALSE, FALSE, 0);
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dont_ask_toggle), FALSE);
|
|
|
|
gtk_widget_show (dont_ask_toggle);
|
2015-08-23 16:51:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (gtk_dialog_run (GTK_DIALOG (dialog)))
|
|
|
|
{
|
Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.
Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).
I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.
On the other hand (and that's why I was hesitating):
* "Keep" is also what happens when we hit "Esc" so some might complain that
there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
as easy as Esc or Enter). Basically it makes the "Convert" option always a
much more explicit choice (yet it is likely for the best for people who care
about their colors).
* There might have been many people who would just use the default (Convert
until now) without thinking too much of what was asked, and that was working
good because they would just publish on the web or similar basic usage. If
they continue just accepting with Enter without reading and understanding what
is asked, now they could publish images with a color profile (and we know it
doesn't always work perfectly on the web).
In other words, it might be the best default for professional usage now, yet
it requires to understand a bit what you are doing.
It's really a hard call!
2022-11-01 23:21:24 +08:00
|
|
|
case GTK_RESPONSE_NO:
|
2020-09-24 22:27:34 +08:00
|
|
|
if (g_strcmp0 (gtk_stack_get_visible_child_name (GTK_STACK (stack)),
|
|
|
|
"builtin") == 0)
|
|
|
|
{
|
|
|
|
policy = GIMP_COLOR_PROFILE_POLICY_CONVERT_BUILTIN;
|
|
|
|
g_object_ref (*dest_profile);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
policy = GIMP_COLOR_PROFILE_POLICY_CONVERT_PREFERRED;
|
|
|
|
*dest_profile = g_object_ref (pref_profile);
|
|
|
|
}
|
2015-08-23 16:51:31 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
policy = GIMP_COLOR_PROFILE_POLICY_KEEP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-06-06 04:36:52 +08:00
|
|
|
if (intent)
|
|
|
|
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (intent_combo),
|
|
|
|
(gint *) intent);
|
|
|
|
|
|
|
|
if (bpc)
|
|
|
|
*bpc = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (bpc_toggle));
|
|
|
|
|
2015-08-23 16:51:31 +08:00
|
|
|
if (dont_ask)
|
2016-06-06 04:36:52 +08:00
|
|
|
*dont_ask = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dont_ask_toggle));
|
2015-08-23 16:51:31 +08:00
|
|
|
|
|
|
|
gtk_widget_destroy (dialog);
|
2020-09-24 22:27:34 +08:00
|
|
|
g_clear_object (&pref_profile);
|
2015-08-23 16:51:31 +08:00
|
|
|
|
|
|
|
return policy;
|
|
|
|
}
|