mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
app, libgimpcolor: refactor GimpColorManaged::get_color_profile()
to not return a reference that has to be dropped. Also allow NULL to be returned if the managed cannot have a profile. If it can have one, get_color_profile() still always returns a profile (either the assigned one, or a generated built-in one).
This commit is contained in:
parent
7c95676f88
commit
b45d31072b
19 changed files with 93 additions and 102 deletions
|
@ -278,15 +278,16 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
|
|||
|
||||
src_profile = gimp_color_managed_get_color_profile (managed);
|
||||
|
||||
lcms->src_format = babl_format ("R'G'B'A float");
|
||||
lcms->dest_format = babl_format ("R'G'B'A float");
|
||||
if (src_profile)
|
||||
{
|
||||
lcms->src_format = babl_format ("R'G'B'A float");
|
||||
lcms->dest_format = babl_format ("R'G'B'A float");
|
||||
|
||||
lcms->transform = gimp_widget_get_color_transform (widget,
|
||||
config, src_profile,
|
||||
&lcms->src_format,
|
||||
&lcms->dest_format);
|
||||
|
||||
g_object_unref (src_profile);
|
||||
lcms->transform = gimp_widget_get_color_transform (widget,
|
||||
config, src_profile,
|
||||
&lcms->src_format,
|
||||
&lcms->dest_format);
|
||||
}
|
||||
}
|
||||
|
||||
static GimpColorProfile *
|
||||
|
@ -362,6 +363,9 @@ cdisplay_lcms_update_profile_label (CdisplayLcms *lcms,
|
|||
if (strcmp (name, "rgb-profile") == 0)
|
||||
{
|
||||
profile = gimp_color_managed_get_color_profile (managed);
|
||||
|
||||
if (profile)
|
||||
g_object_ref (profile);
|
||||
}
|
||||
else if (g_str_has_prefix (name, "display-profile"))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue