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

This commit is contained in:
lloyd konneker 2021-05-13 09:09:26 -04:00 committed by Lloyd Konneker
parent 4f99f1fcfd
commit 513d331ae2
7 changed files with 19 additions and 23 deletions

View File

@ -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)))

View File

@ -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")
)
)
)

View File

@ -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)

View File

@ -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)
)

View File

@ -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)
)

View File

@ -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

View File

@ -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)