diff --git a/app/pdb/image-color-profile-cmds.c b/app/pdb/image-color-profile-cmds.c index 806bbd2e95..855f081dbc 100644 --- a/app/pdb/image-color-profile-cmds.c +++ b/app/pdb/image-color-profile-cmds.c @@ -143,7 +143,7 @@ image_set_color_profile_invoker (GimpProcedure *procedure, if (success) { - if (color_profile) + if (color_profile && g_bytes_get_size (color_profile) > 0) { GimpColorProfile *profile; @@ -272,7 +272,7 @@ image_set_simulation_profile_invoker (GimpProcedure *procedure, if (success) { - if (color_profile) + if (color_profile && g_bytes_get_size (color_profile) > 0) { GimpColorProfile *profile; diff --git a/libgimp/gimpimagecolorprofile.c b/libgimp/gimpimagecolorprofile.c index 71c99b56f0..ff7894dfdc 100644 --- a/libgimp/gimpimagecolorprofile.c +++ b/libgimp/gimpimagecolorprofile.c @@ -67,6 +67,9 @@ gimp_image_get_color_profile (GimpImage *image) * * This procedure sets the image's color profile. * + * If %NULL is passed as @profile, then the built-in profile for + * @image's color model is set. + * * Returns: %TRUE on success. * * Since: 2.10 @@ -140,6 +143,8 @@ gimp_image_get_simulation_profile (GimpImage *image) * * This procedure sets the image's simulation color profile. * + * If %NULL is passed as @profile, then the simulation profile is unset. + * * Returns: %TRUE on success. * * Since: 3.0 diff --git a/libgimp/gimpimagecolorprofile_pdb.c b/libgimp/gimpimagecolorprofile_pdb.c index 0ce5d6ee22..635ec010ba 100644 --- a/libgimp/gimpimagecolorprofile_pdb.c +++ b/libgimp/gimpimagecolorprofile_pdb.c @@ -116,7 +116,7 @@ _gimp_image_get_effective_color_profile (GimpImage *image) /** * _gimp_image_set_color_profile: * @image: The image. - * @color_profile: The new serialized color profile. + * @color_profile: (nullable): The new serialized color profile. * * Sets the image's color profile * @@ -238,7 +238,7 @@ _gimp_image_get_simulation_profile (GimpImage *image) /** * _gimp_image_set_simulation_profile: * @image: The image. - * @color_profile: The new serialized simulation color profile. + * @color_profile: (nullable): The new serialized simulation color profile. * * Sets the image's simulation color profile * diff --git a/pdb/groups/image_color_profile.pdb b/pdb/groups/image_color_profile.pdb index 8f2f81bae6..bbbbf420d2 100644 --- a/pdb/groups/image_color_profile.pdb +++ b/pdb/groups/image_color_profile.pdb @@ -122,14 +122,14 @@ HELP @inargs = ( { name => 'image', type => 'image', desc => 'The image' }, - { name => 'color_profile', type => 'bytes', + { name => 'color_profile', type => 'bytes', none_ok => 1, desc => 'The new serialized color profile' } ); %invoke = ( code => <<'CODE' { - if (color_profile) + if (color_profile && g_bytes_get_size (color_profile) > 0) { GimpColorProfile *profile; @@ -263,14 +263,14 @@ HELP @inargs = ( { name => 'image', type => 'image', desc => 'The image' }, - { name => 'color_profile', type => 'bytes', + { name => 'color_profile', type => 'bytes', none_ok => 1, desc => 'The new serialized simulation color profile'} ); %invoke = ( code => <<'CODE' { - if (color_profile) + if (color_profile && g_bytes_get_size (color_profile) > 0) { GimpColorProfile *profile;