Uff... Udało mi się w końcu*
Skrypt do GIMP-a:
(define (add-text-to-picture filename text-to-display)
(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image)))
)
(script-fu-add-text-to-picture image drawable text-to-display "Sans" 14)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
))
(define (script-fu-add-text-to-picture image drawable text text-font text-size)
(let* ()
(gimp-image-undo-group-start image)
(gimp-floating-sel-anchor
(car
(gimp-text-fontname image drawable 200 200 text 1 1 text-size 1 text-font)
)
)
(gimp-image-undo-group-end image)
(gimp-displays-flush)
))
(script-fu-register
"script-fu-add-text-to-picture"
"Add text on picture"
"Adding text with special size and font on picture"
"Ziomioslaw"
"Copyright 2014, gimpuj.info"
"March 9, 2014"
"*"
SF-IMAGE "Input image" 0
SF-DRAWABLE "Input drawable" 0
SF-STRING "Text" ""
SF-FONT "Font" "Sans"
SF-ADJUSTMENT "Font size" '(12 1 1000 1 10 0 1)
)
(script-fu-menu-register "script-fu-add-text-to-picture" "<Image>/Filters/Text")
Skrypt do powłoki:
#!/bin/bash
{
for file in *.png
do
echo "(add-text-to-picture \"${file}\" \"${file%.*}\")"
done
echo "(gimp-quit 0)"
} | gimp -i -b -
Co prawda skrypt nie robi jeszcze dokładnie tego czego potrzebujesz (np. położenie) (teraz już tak), ale nie wiedziałem, czy tu jeszcze zajrzysz:P No i te poprawki to chwila w porównaniu do reszty:)
* - tak naprawdę to "w końcu się za to wziąłem"