diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-06-21 14:58:06 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-06-21 14:58:06 +0200 |
commit | 13621463f4339ac4eb7683664fbb4e4513beadfa (patch) | |
tree | 84c88f878cee3b98f9ea441f6852e4f9732a3b73 /bin/xcf-to-pdf | |
parent | c429bd2f143c3bd2a86fcc09523dcaf6df17c63e (diff) | |
download | spiewnik-13621463f4339ac4eb7683664fbb4e4513beadfa.tar.gz spiewnik-13621463f4339ac4eb7683664fbb4e4513beadfa.zip |
Akordy
Diffstat (limited to 'bin/xcf-to-pdf')
-rwxr-xr-x | bin/xcf-to-pdf | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/xcf-to-pdf b/bin/xcf-to-pdf new file mode 100755 index 0000000..34da9c8 --- /dev/null +++ b/bin/xcf-to-pdf @@ -0,0 +1,23 @@ +#!/bin/sh +{ +cat <<EOF +(define (convert-xcf-to-pdf filename outfile) + (let* ( + (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) + (drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) + ) + (file-pdf-save RUN-NONINTERACTIVE image drawable outfile outfile TRUE TRUE TRUE) + (gimp-image-delete image) ; ... or the memory will explode + ) +) + +(gimp-message-set-handler 1) ; Messages to standard output +EOF + +for i in $*; do + echo "(gimp-message \"$i\")" + echo "(convert-xcf-to-pdf \"$i\" \"${i%%.xcf}.pdf\")" +done + +echo "(gimp-quit 0)" +} | gimp -i -b - |