GNOME Bugzilla – Bug 781408
script fails due to error in edit-copy / edit-paste
Last modified: 2017-04-19 19:46:53 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.
Thanks. I think I already found the problem in the meantime, will fix and verify with your script to be sure.
"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.
I know, already completely fixed, along with some other incomplete stuff regarding clipboard images.
(fixed in my tree, will push later today)
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(-)