mirror of https://github.com/GNOME/gimp.git
app: don't use a NULL profile to create the new "layer from visible"
While NULL does the right thing, better not rely on that magic parameter, pass the right profile and let the profile convert logic do its job.
This commit is contained in:
parent
08b67de9bf
commit
95f7cab96c
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "actions-types.h"
|
||||
|
@ -349,15 +350,18 @@ void
|
|||
layers_new_from_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpPickable *pickable;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpPickable *pickable;
|
||||
GimpColorProfile *profile;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
pickable = GIMP_PICKABLE (image);
|
||||
|
||||
gimp_pickable_flush (pickable);
|
||||
|
||||
profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
|
||||
|
||||
layer = gimp_layer_new_from_gegl_buffer (gimp_pickable_get_buffer (pickable),
|
||||
image,
|
||||
gimp_image_get_layer_format (image,
|
||||
|
@ -365,7 +369,7 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
|
|||
_("Visible"),
|
||||
GIMP_OPACITY_OPAQUE,
|
||||
GIMP_NORMAL_MODE,
|
||||
NULL /* same image */);
|
||||
profile);
|
||||
|
||||
gimp_image_add_layer (image, layer,
|
||||
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
|
||||
|
|
Loading…
Reference in New Issue