mirror of https://github.com/GNOME/gimp.git
plug-ins: attach the default comment to all screenshots
not only to screenshots made with the X11 backend.
This commit is contained in:
parent
790cde3dd8
commit
f67100f554
|
@ -407,7 +407,6 @@ create_image (cairo_surface_t *surface,
|
|||
gint32 image;
|
||||
gint32 layer;
|
||||
gdouble xres, yres;
|
||||
gchar *comment;
|
||||
gint width, height;
|
||||
|
||||
gimp_progress_init (_("Importing screenshot"));
|
||||
|
@ -421,20 +420,6 @@ create_image (cairo_surface_t *surface,
|
|||
gimp_get_monitor_resolution (&xres, &yres);
|
||||
gimp_image_set_resolution (image, xres, yres);
|
||||
|
||||
comment = gimp_get_default_comment ();
|
||||
if (comment)
|
||||
{
|
||||
GimpParasite *parasite;
|
||||
|
||||
parasite = gimp_parasite_new ("gimp-comment", GIMP_PARASITE_PERSISTENT,
|
||||
strlen (comment) + 1, comment);
|
||||
|
||||
gimp_image_attach_parasite (image, parasite);
|
||||
gimp_parasite_free (parasite);
|
||||
|
||||
g_free (comment);
|
||||
}
|
||||
|
||||
layer = gimp_layer_new_from_surface (image,
|
||||
name ? name : _("Screenshot"),
|
||||
surface,
|
||||
|
|
|
@ -273,6 +273,24 @@ run (const gchar *name,
|
|||
|
||||
if (status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
gchar *comment = gimp_get_default_comment ();
|
||||
|
||||
if (comment)
|
||||
{
|
||||
GimpParasite *parasite;
|
||||
|
||||
parasite = gimp_parasite_new ("gimp-comment",
|
||||
GIMP_PARASITE_PERSISTENT,
|
||||
strlen (comment) + 1, comment);
|
||||
|
||||
gimp_image_attach_parasite (image_ID, parasite);
|
||||
gimp_parasite_free (parasite);
|
||||
|
||||
g_free (comment);
|
||||
}
|
||||
|
||||
gimp_image_clean_all (image_ID);
|
||||
|
||||
if (run_mode == GIMP_RUN_INTERACTIVE)
|
||||
{
|
||||
/* Store variable states for next run */
|
||||
|
|
Loading…
Reference in New Issue