After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781408 - script fails due to error in edit-copy / edit-paste
script fails due to error in edit-copy / edit-paste
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: libgimp
2.9.4
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-04-17 15:03 UTC by P.Suetterlin
Modified: 2017-04-19 19:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Working version of the script (6.99 KB, text/x-scheme)
2017-04-17 15:03 UTC, P.Suetterlin
Details

Description P.Suetterlin 2017-04-17 15:03:56 UTC
Created attachment 349947 [details]
Working version of the script

I tried to run the script 'Maximize Local Contrast' (http://registry.gimp.org/node/17151) that I regularly use in gimp 2.8.  

Except for some deprecated function calls that I could replace with the recommended ones, one final error stayed:
In a last step an edit buffer that was captured using gimp-edit-copy before should be pasted into a layer mask using gimp-edit-paste.

This last action fails because the copy buffer is empty.

I could fix that by explicitly selecting the whole area before the copy call.  Documentation says without selection it should copy the whole drawable, but it doesn't....

For reference I attach the script as I use it now (it works correctly like that)
The relevant fix is the selection-all call in line 141 - without that it fails.
Comment 1 Michael Natterer 2017-04-17 16:18:04 UTC
Thanks. I think I already found the problem in the meantime, will fix
and verify with your script to be sure.
Comment 2 Thomas Manni 2017-04-18 20:39:37 UTC
"gimp-edit-paste-as-new-image" procedure is also affected.

"gimp-edit-copy" calls gimp_edit_copy core function, which store in the clipboard
- a GimpBuffer if a selection exists
- a GimpImage if no selection

edit_paste_invoker and edit_paste_as_new_image_invoker only check for the GimpBuffer clipboard.
Comment 3 Michael Natterer 2017-04-19 14:26:03 UTC
I know, already completely fixed, along with some other incomplete
stuff regarding clipboard images.
Comment 4 Michael Natterer 2017-04-19 14:26:57 UTC
(fixed in my tree, will push later today)
Comment 5 Michael Natterer 2017-04-19 19:46:53 UTC
Fixed in master:

commit c2f0226f66fd9a46e4158819cd96bc809518afdd
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Apr 19 16:44:08 2017 -0300

    Bug 781408 - script fails due to error in edit-copy / edit-paste
    
    Fix the edit-paste and edit-paste-as-new-image PDB wrappers to use
    gimp_get_clipboard_object(), not just clipboard_buffer(), and deal
    correctly with entire images in the clipboard.

 app/pdb/edit-cmds.c       | 21 +++++++++++++++------
 tools/pdbgen/pdb/edit.pdb | 21 +++++++++++++++------
 2 files changed, 30 insertions(+), 12 deletions(-)