[gimp] Fix #6842 by deleting second of two strings passed for filenames, in scripts



commit 513d331ae240b3b95f0c3bc5fbf555b08eb7474f
Author: lloyd konneker <konnekerl gmail com>
Date:   Thu May 13 09:09:26 2021 -0400

    Fix #6842 by deleting second of two strings passed for filenames, in scripts

 plug-ins/script-fu/scripts/chrome-it.scm         |  2 +-
 plug-ins/script-fu/scripts/contactsheet.scm      |  6 ++----
 plug-ins/script-fu/scripts/mkbrush.scm           |  8 ++++----
 plug-ins/script-fu/scripts/paste-as-brush.scm    | 10 +++++-----
 plug-ins/script-fu/scripts/paste-as-pattern.scm  |  8 ++++----
 plug-ins/script-fu/scripts/script-fu-util.scm    |  6 ++----
 plug-ins/script-fu/scripts/select-to-pattern.scm |  2 +-
 7 files changed, 19 insertions(+), 23 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/chrome-it.scm b/plug-ins/script-fu/scripts/chrome-it.scm
index aea4a0b7ec..c67fe3aa12 100644
--- a/plug-ins/script-fu/scripts/chrome-it.scm
+++ b/plug-ins/script-fu/scripts/chrome-it.scm
@@ -73,7 +73,7 @@
   )
 
   (let* (
-        (banding-img (car (gimp-file-load RUN-NONINTERACTIVE env-map env-map)))
+        (banding-img (car (gimp-file-load RUN-NONINTERACTIVE env-map)))
         (banding-layer (car (gimp-image-get-active-drawable banding-img)))
         (banding-height (car (gimp-drawable-get-height banding-layer)))
         (banding-width (car (gimp-drawable-get-width banding-layer)))
diff --git a/plug-ins/script-fu/scripts/contactsheet.scm b/plug-ins/script-fu/scripts/contactsheet.scm
index a878e4f8a5..28a0804a3c 100644
--- a/plug-ins/script-fu/scripts/contactsheet.scm
+++ b/plug-ins/script-fu/scripts/contactsheet.scm
@@ -214,12 +214,13 @@
           ( (eof-object? file) )
 
           (set! file-path (string-append dir DIR-SEPARATOR file))
+          ; file-path is a full path, file is filename
           (if (and (not (re-match "index.*" file))
                    (= (file-type file-path) FILE-TYPE-FILE)
               )
             (catch ()
               (set! new-img
-                    (car (gimp-file-load RUN-NONINTERACTIVE file-path file)))
+                    (car (gimp-file-load RUN-NONINTERACTIVE file-path)))
 
               (make-thumbnail-size new-img thumb-w thumb-h)
 
@@ -269,8 +270,6 @@
                         sheet-layer
                         (string-append dir DIR-SEPARATOR
                             "index" (number->string sheet-num) ".jpg")
-                        (string-append
-                            "index" (number->string sheet-num) ".jpg")
                       )
 
                       (set! sheet-num (+ sheet-num 1))
@@ -296,7 +295,6 @@
               sheet-layer
               (string-append dir DIR-SEPARATOR
                   "index" (number->string sheet-num) ".jpg")
-              (string-append "index" (number->string sheet-num) ".jpg")
             )
           )
         )
diff --git a/plug-ins/script-fu/scripts/mkbrush.scm b/plug-ins/script-fu/scripts/mkbrush.scm
index 7a316a4885..614ae0301b 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 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 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 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 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 062e97d140..e56c0980a9 100644
--- a/plug-ins/script-fu/scripts/paste-as-brush.scm
+++ b/plug-ins/script-fu/scripts/paste-as-brush.scm
@@ -34,7 +34,7 @@
                                   filename
                                   (number->string brush-image)
                                   ".gbr"))
-       
+
         (if (= type GRAYA-IMAGE)
             (begin
                 (gimp-context-push)
@@ -43,13 +43,13 @@
                 (gimp-context-pop)
             )
         )
-       
+
         (file-gbr-save RUN-NONINTERACTIVE
-                       brush-image brush-draw path path
+                       brush-image brush-draw path
                        spacing name)
-       
+
         (gimp-image-delete brush-image)
-       
+
         (gimp-brushes-refresh)
         (gimp-context-set-brush name)
       )
diff --git a/plug-ins/script-fu/scripts/paste-as-pattern.scm b/plug-ins/script-fu/scripts/paste-as-pattern.scm
index 01381a2c91..ebfb581b5d 100644
--- a/plug-ins/script-fu/scripts/paste-as-pattern.scm
+++ b/plug-ins/script-fu/scripts/paste-as-pattern.scm
@@ -31,13 +31,13 @@
                              filename
                              (number->string pattern-image)
                              ".pat"))
-       
+
         (file-pat-save RUN-NONINTERACTIVE
-                       pattern-image pattern-draw path path
+                       pattern-image pattern-draw path
                        name)
-       
+
         (gimp-image-delete pattern-image)
-       
+
         (gimp-patterns-refresh)
         (gimp-context-set-pattern name)
       )
diff --git a/plug-ins/script-fu/scripts/script-fu-util.scm b/plug-ins/script-fu/scripts/script-fu-util.scm
index 7f9a8e450b..b67fa67d52 100644
--- a/plug-ins/script-fu/scripts/script-fu-util.scm
+++ b/plug-ins/script-fu/scripts/script-fu-util.scm
@@ -61,13 +61,12 @@
 ; start directory:
 ;
 ;    gimp -i -b '(with-files "*.png" (gimp-drawable-invert layer FALSE) \
-;                 (gimp-file-save 1 image layer filename filename ))'
+;                 (gimp-file-save 1 image layer filename))'
 ;
 ; To do the same thing, but saving them as jpeg instead:
 ;
 ;    gimp -i -b '(with-files "*.png" (gimp-drawable-invert layer FALSE) \
 ;                 (gimp-file-save 1 image layer \
-;                  (string-append basename ".jpg") \
 ;                  (string-append basename ".jpg") ))'
 
 (define-macro (with-files pattern . body)
@@ -79,8 +78,7 @@
          (unless (null? ,filenames)
            (let* ((filename (car ,filenames))
                   (image (catch #f (car (gimp-file-load RUN-NONINTERACTIVE
-                                                        filename
-                                                        filename ))))
+                                                        filename))))
                   (layer (if image (car (gimp-image-get-active-layer image)) #f))
                   (basename (unbreakupstr (butlast (strbreakup filename ".")) ".")))
              (when image
diff --git a/plug-ins/script-fu/scripts/select-to-pattern.scm 
b/plug-ins/script-fu/scripts/select-to-pattern.scm
index 5c532b349c..23f7528b31 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 pattern-draw filename2 desc)
   (gimp-patterns-refresh)
   (gimp-context-set-pattern desc)
 


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