Add scaffold GIMP plugin.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 20 Jun 2019 19:22:18 +0000 (21:22 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 20 Jun 2019 19:22:18 +0000 (21:22 +0200)
gimp_passport_plugin.py [new file with mode: 0755]

diff --git a/gimp_passport_plugin.py b/gimp_passport_plugin.py
new file mode 100755 (executable)
index 0000000..12316f7
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+
+from gimpfu import *
+#import pdb
+
+def create_passport(image, drawable, paper_height_mm, paper_width_mm):
+    # Note: for interactive sessions you can get the image via:
+    # image = gimp.image_list()[0]
+
+    # non_empty, x1, y1, x2, y2 = pdb.gimp_selection_bounds(image)
+
+    # pdb.gimp_image_find_next_guide(image, 0)
+    # pdb.gimp_image_get_guide_orientation(image, 6)
+    # pdb.gimp_image_get_guide_position(image, 6)
+    pdb.gimp_image_flip(image, 1)
+    return image
+
+
+register(
+        "create_passport",
+        "Creates a printable passport image (contact sheet) from a photo",
+        "Select the face and call the plugin",
+        "Toastfreeware",
+        "Toastfreeware",
+        "2019",
+        "<Image>/Filters/Map/Create _Passport...",
+        "RGB*, GRAY*",
+        [
+                (PF_INT, "paper_height_mm", "Paper height in mm", 100),
+                (PF_INT, "paper_width_mm", "Paper width in mm", 150),
+        ],
+        [],
+        create_passport)
+
+
+main()
+