;; file KLEIDER/web/src/lockal/selection-dir.scm ;; Ausschnitt-Daten aus Bildern in einem Verzeichnis ;; 2021-03-25 Herbert Schiemann ;; verarbeitet das Bild ;; img das Bild ;; step 0 das Bild ist neu geƶffnet ;; 1 das Bild wird geschlossen ;; Ergebnis im Falle (= step 0) ;; #f die Verarbeitung wird nicht automatisch fortgesetzt ;; sonst die Verarbeitung wird automatisch fortgesetzt ;; Ergebnis im Falle (= step 1): '(save note) ;; save #t oder #f : Bild speichern ;; note #f / () / "" : keine note-Datei erstellen, sonst note in Datei schreiben (define (de-herbaer-selection-dir image step) (if (= step 0) #f (if (= TRUE (car (gimp-image-is-dirty image))) (let ((bounds (gimp-selection-bounds image)) (w (car (gimp-image-width image))) (h (car (gimp-image-height image))) ) (if (= TRUE (car bounds)) (let* ((x1 (begin (set! bounds (cdr bounds)) (car bounds))) (y1 (begin (set! bounds (cdr bounds)) (car bounds))) (x2 (begin (set! bounds (cdr bounds)) (car bounds))) (y2 (begin (set! bounds (cdr bounds)) (car bounds))) ) (gimp-displays-flush) (list #f ; das Bild wird nicht gespeichert (list ; Info-Datei 'name (car (gimp-image-get-name image)) 'img-size w h 'sel-offset x1 y1 'sel-size (- x2 x1) (- y2 y1)))) (list #f #f))) (list #f #f))) ; das Bild wird nicht gespeichert ) ; de-herbaer-selection-dir (define (script-fu-de-herbaer-selection-dir dir-in dir-out) (de-herbaer-process-dir dir-in dir-out #t (quote de-herbaer-selection-dir)) ) ; script-fu-de-herbaer-selection-dir (script-fu-register "script-fu-de-herbaer-selection-dir" _"Ausschnittdaten" _"Aus allen Bilder des Quellverzeichnisses die Daten eines rechteckigen Ausschnitts ausgeben" "Herbert Schiemann" "(C) 2021 Herbert Schiemann, GPL" "2021-03-25" "" SF-DIRNAME "Quell-Verzeichnis" "" SF-DIRNAME "Ziel-Verzeichnis" "" ) (script-fu-menu-register "script-fu-de-herbaer-selection-dir" "/_Filters/Verzeichnis") ;; end of file KLEIDER/web/src/lockal/selection-dir.scm