[Gimp-developer] png file exports - disable metadata?
Hi All, I am wondering about a curious event I am seeing related to exporting PNG images from Gimp either through the usual interface, or via a script like so: pdb.file_png_save2(gimp.image_list()[0], gimp.image_list()[0].layers[0], '/tmp/test1.png', '/tmp/test1.png', 0, 0, 0, 0, 0, 0, 0, 0, 0) pdb.file_png_save2(gimp.image_list()[0], gimp.image_list()[0].layers[0], '/tmp/test2.png', '/tmp/test2.png', 0, 0, 0, 0, 0, 0, 0, 0, 0) It seems that exporting these two pngs, some different data is written because they have a different sha1sum. (I would guess timestamp, but I disabled this with the plugin option as shown) This weirdness does not seem to happen with other file formats like webp, raw, etc. Is there any way to disable the writing of this extra data? ___ gimp-developer-list mailing list List address:gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list
[Gimp-developer] Editing last stroke / modification through gimp plugins
Hey all. I have been writing small plugins using the python engine for quite a while, it is very nice and I appreciate the great batch functionality available. I am interested in writing some functionality that deals with working with the last brushstroke. Ideally, I would be able to enable my plugin and it applies to all brush strokes (individually) until I turn it off, but I would also settle for just running it with a hotkey after making a stroke. I know these states must be stored somewhere because they are in the undo history. So far the only equivalent I have been able to come up with is to run a background thread that iterated over the canvas repeatedly to check if there are any deltas, and wait until no more are found, but obviously this is inefficient and inaccurate. Is there a better way available currently? I am usually using python-fu style but I have also used the scheme engine for a few projects. Thanks for your help. ___ gimp-developer-list mailing list List address:gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list
[Gimp-developer] question about python-fu and GTK+ 3.0
Good evening, I have been writing some python plug-ins for gimp over the past months with great success. I really appreciate the effort that has gone into creation of the plugin system. I have one question specifically, which is a little more advanced. I am trying to create a small interface for the plugin using GTK. I have in the past used python-gtk (`import gtk`), which worked when launched from a gimp plugin without a hitch. I have seen in many places that this library is deprecated and that I should switch to GTK+ 3.0 if possible. Following standard introductions, I arrive at a plugin file with the following content: #!/usr/bin/env python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gimpfu import * class BaseUI2(object): def __init__(self): win = Gtk.Window() win.connect("destroy", Gtk.main_quit) win.show_all() def main(self): Gtk.main() def g_test(img, drawable): w = BaseUI2() w.main() register("g-test", "", "", "", "", "", "/Image/G - Test", "RGB, RGB*", [ ], [], g_test ) main() --- While the UI code runs fine when interpreted with standard python2.7 (or 3), trying to launch from a plugin gives: "ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183; , which I have read is a symptom from trying to use "gtk" and "gi" together. I assume that the "gtk" import is happening somewhere in the lower level code and is causing this issue, but I am not sure. Is there any way to use the python GTK+ 3.0 bindings in a GIMP plugin currently? Thank you for reading, -Paul ___ gimp-developer-list mailing list List address:gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list