plug-ins: attach the default comment to all screenshots

not only to screenshots made with the X11 backend.
This commit is contained in:
Michael Natterer 2016-05-31 22:29:49 +02:00
parent 790cde3dd8
commit f67100f554
2 changed files with 18 additions and 15 deletions

View File

@ -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,

View File

@ -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 */