Fix broken call of function tile (parameter count changed) by using process().
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 1 Jul 2019 18:43:07 +0000 (20:43 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 1 Jul 2019 18:43:07 +0000 (20:43 +0200)
gimp_passport_plugin.py

index 5564518..4804140 100755 (executable)
@@ -22,7 +22,6 @@ def create_passport(image, drawable, paper_height_mm, paper_width_mm):
 
     photo_width_mm = 35.
     photo_height_mm = 45.
 
     photo_width_mm = 35.
     photo_height_mm = 45.
-    fpr = 0.75
     margin_mm = 4.
     spacing_mm = 1.
 
     margin_mm = 4.
     spacing_mm = 1.
 
@@ -31,9 +30,8 @@ def create_passport(image, drawable, paper_height_mm, paper_width_mm):
     pil_img = PIL.Image.frombytes('RGB', (drawable.width, drawable.height), rgn[:, :])
 
     # perform processing
     pil_img = PIL.Image.frombytes('RGB', (drawable.width, drawable.height), rgn[:, :])
 
     # perform processing
-    # pil_paper = pil_img.crop((left, top, right, bottom))
-    pil_photo = gimp_passport.make_passport(pil_img, (left, top, right, bottom), fpr, photo_width_mm, photo_height_mm)
-    pil_paper = gimp_passport.tile(pil_photo, paper_width_mm, paper_height_mm, margin_mm, spacing_mm)
+    pil_paper = gimp_passport.process(paper_width_mm, paper_height_mm, margin_mm, photo_width_mm, photo_height_mm, spacing_mm, 
+                                      None, (left, top, right, bottom), pil_img)
 
     # copy processed PIL to new GIMP image
     image_new = pdb.gimp_image_new(pil_paper.width, pil_paper.height, pdb.gimp_image_base_type(image))
 
     # copy processed PIL to new GIMP image
     image_new = pdb.gimp_image_new(pil_paper.width, pil_paper.height, pdb.gimp_image_base_type(image))