[gimp] Fix #8091 ScriptFu scripts use v3 API for drawables in calls to file procedures



commit a1f0757ee7f40b61c35423775c229b16ee66df67
Author: lloyd konneker <konnekerl gmail com>
Date:   Tue May 3 08:50:50 2022 -0400

    Fix #8091 ScriptFu scripts use v3 API for drawables in calls to file procedures
    
    This change is part of multilayer select feature of v3.
    
    Only fixes ScriptFu plugins, not Python or C.
    Only fixes calls to file load/save procedures and other plugins already multilayer capable.
    Any future PDB procedures changed to have multilayer signature will require changes to all callers.
    
    The new code is verbose: "drawable" => "1 (vector drawable)"
    Issue 5919 proposes a change to the PDB that would make this less verbose:
    "drawable" => (vector drawable)" (without the number of drawables)
    
    Tested that changed procedures will interpret without syntax errors, on one path.
    Did not test each changed procedure for functional correctness.

 plug-ins/script-fu/scripts/contactsheet.scm      | 4 ++--
 plug-ins/script-fu/scripts/gradient-example.scm  | 2 +-
 plug-ins/script-fu/scripts/mkbrush.scm           | 8 ++++----
 plug-ins/script-fu/scripts/paste-as-brush.scm    | 4 +++-
 plug-ins/script-fu/scripts/paste-as-pattern.scm  | 4 +++-
 plug-ins/script-fu/scripts/select-to-pattern.scm | 2 +-
 plug-ins/script-fu/scripts/spinning-globe.scm    | 3 ++-
 7 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/contactsheet.scm b/plug-ins/script-fu/scripts/contactsheet.scm
index 28a0804a3c..04034ff732 100644
--- a/plug-ins/script-fu/scripts/contactsheet.scm
+++ b/plug-ins/script-fu/scripts/contactsheet.scm
@@ -267,7 +267,7 @@
                       (gimp-file-save
                         RUN-NONINTERACTIVE
                         sheet-img
-                        sheet-layer
+                        1 (vector sheet-layer)
                         (string-append dir DIR-SEPARATOR
                             "index" (number->string sheet-num) ".jpg")
                       )
@@ -292,7 +292,7 @@
             (gimp-file-save
               RUN-NONINTERACTIVE
               sheet-img
-              sheet-layer
+              1 (vector sheet-layer)
               (string-append dir DIR-SEPARATOR
                   "index" (number->string sheet-num) ".jpg")
             )
diff --git a/plug-ins/script-fu/scripts/gradient-example.scm b/plug-ins/script-fu/scripts/gradient-example.scm
index 3157c889bf..e1e64ea825 100644
--- a/plug-ins/script-fu/scripts/gradient-example.scm
+++ b/plug-ins/script-fu/scripts/gradient-example.scm
@@ -41,7 +41,7 @@
 
     (gimp-context-set-foreground (list fg-color fg-color fg-color))
     (gimp-context-set-background (list bg-color bg-color bg-color))
-    (plug-in-checkerboard RUN-NONINTERACTIVE img drawable 0 8)
+    (plug-in-checkerboard RUN-NONINTERACTIVE img 1 (vector drawable) 0 8)
 
     (gimp-context-pop)
 
diff --git a/plug-ins/script-fu/scripts/mkbrush.scm b/plug-ins/script-fu/scripts/mkbrush.scm
index 614ae0301b..84c970a25e 100644
--- a/plug-ins/script-fu/scripts/mkbrush.scm
+++ b/plug-ins/script-fu/scripts/mkbrush.scm
@@ -49,7 +49,7 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
-    (file-gbr-save 1 img drawable filename spacing name)
+    (file-gbr-save 1 img 1 (vector drawable) filename spacing name)
     (gimp-image-delete img)
 
     (gimp-context-pop)
@@ -119,7 +119,7 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
-    (file-gbr-save 1 img drawable filename spacing name)
+    (file-gbr-save 1 img 1 (vector drawable) filename spacing name)
     (gimp-image-delete img)
 
     (gimp-context-pop)
@@ -175,7 +175,7 @@
 
     (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
-    (file-gbr-save 1 img drawable filename spacing name)
+    (file-gbr-save 1 img 1 (vector drawable) filename spacing name)
     (gimp-image-delete img)
 
     (gimp-context-pop)
@@ -244,7 +244,7 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
-    (file-gbr-save 1 img drawable filename spacing name)
+    (file-gbr-save 1 img 1 (vector drawable) filename spacing name)
     (gimp-image-delete img)
 
     (gimp-context-pop)
diff --git a/plug-ins/script-fu/scripts/paste-as-brush.scm b/plug-ins/script-fu/scripts/paste-as-brush.scm
index e56c0980a9..555e731ad1 100644
--- a/plug-ins/script-fu/scripts/paste-as-brush.scm
+++ b/plug-ins/script-fu/scripts/paste-as-brush.scm
@@ -45,7 +45,9 @@
         )
 
         (file-gbr-save RUN-NONINTERACTIVE
-                       brush-image brush-draw path
+                       brush-image
+                       1 (vector brush-draw)
+                       path
                        spacing name)
 
         (gimp-image-delete brush-image)
diff --git a/plug-ins/script-fu/scripts/paste-as-pattern.scm b/plug-ins/script-fu/scripts/paste-as-pattern.scm
index ebfb581b5d..5f4f2f75a9 100644
--- a/plug-ins/script-fu/scripts/paste-as-pattern.scm
+++ b/plug-ins/script-fu/scripts/paste-as-pattern.scm
@@ -33,7 +33,9 @@
                              ".pat"))
 
         (file-pat-save RUN-NONINTERACTIVE
-                       pattern-image pattern-draw path
+                       pattern-image
+                       1 (vector pattern-draw)
+                       path
                        name)
 
         (gimp-image-delete pattern-image)
diff --git a/plug-ins/script-fu/scripts/select-to-pattern.scm 
b/plug-ins/script-fu/scripts/select-to-pattern.scm
index 23f7528b31..071f702926 100644
--- a/plug-ins/script-fu/scripts/select-to-pattern.scm
+++ b/plug-ins/script-fu/scripts/select-to-pattern.scm
@@ -80,7 +80,7 @@
                                  (number->string image)
                                  ".pat"))
 
-  (file-pat-save 1 pattern-image pattern-draw filename2 desc)
+  (file-pat-save 1 pattern-image 1 (vector pattern-draw) filename2 desc)
   (gimp-patterns-refresh)
   (gimp-context-set-pattern desc)
 
diff --git a/plug-ins/script-fu/scripts/spinning-globe.scm b/plug-ins/script-fu/scripts/spinning-globe.scm
index 15498300ee..f3a2ad0339 100644
--- a/plug-ins/script-fu/scripts/spinning-globe.scm
+++ b/plug-ins/script-fu/scripts/spinning-globe.scm
@@ -49,7 +49,8 @@
                                         (number->string (- inFrames n) 10)
                                         " (replace)"))
     (plug-in-map-object RUN-NONINTERACTIVE
-                        theImage theFrame    ; mapping
+                        theImage             ; mapping image
+                        1 (vector theFrame)  ; mapping drawables
                         1                    ; viewpoint
                         0.5 0.5 2.0          ; object pos
                         0.5 0.5 0.0          ; first axis


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]