diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-11-14 17:38:33 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-11-14 21:00:32 +0200 |
commit | 433bb35ceeb64e6442e10491f72f635d5ebe7bc0 (patch) | |
tree | ed17754629f2fa3ddb5ded1aaa3d28c58ddf7bd7 | |
parent | 6f4542fb9ab491912532468766b0f0f4adb0cb67 (diff) | |
download | gimp-plugin-img-433bb35ceeb64e6442e10491f72f635d5ebe7bc0.tar.gz |
Update Script-Fu
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | README.ru | 2 | ||||
-rw-r--r-- | img-fu | 21 | ||||
-rw-r--r-- | test.scm | 15 |
4 files changed, 27 insertions, 28 deletions
@@ -2,6 +2,7 @@ MAIN = plugin-img GIMPTOOL = gimptool-2.0 GIMP = gimp +GIMPCONSOLE = gimp-console CC = cc LD = cc CFLAGS = -O2 -Wall -Wextra @@ -18,13 +19,15 @@ $(OBJ): $(HDR) Makefile .c.o: $(CC) `$(GIMPTOOL) --cflags` $(CFLAGS) -c $< -o $@ -.PHONY: test -test: install - gimp samples/*.img +.PHONY: view +view: install + $(GIMP) samples/*.img -.PHONY: test-fu -test-fu: install img-fu - $(GIMP) --no-interface --batch - < img-fu +.PHONY: test +test: test.scm install + rm -f samples/success + $(GIMPCONSOLE) --no-interface --batch - < $< + test -f samples/success .PHONY: install install: $(MAIN) @@ -37,4 +40,6 @@ uninstall: .PHONY: clean clean: rm -f *.o *.i *.s $(MAIN) + rm -f samples/recoded-* + rm -f samples/success @@ -26,7 +26,7 @@ F2-как у меня), то файл сохранится в том же фор размеры всех слоёв должны совпадать с размерами изображения. Если что-то не так плагин скажет об этом. -Пример неинтерактивной работы плагина показан в файле img-fu. + Пример неинтерактивной работы плагина показан в файле test.scm. @@ -1,21 +0,0 @@ -(define (img-recode - srcfile - destfile - fmt - ckey) - -(let* - ( - (image (car (file-img-load RUN-NONINTERACTIVE srcfile srcfile))) - (drawable (car (gimp-image-get-active-layer image))) - ) - - (file-img-save RUN-NONINTERACTIVE image drawable destfile destfile fmt ckey) -) -) - -(img-recode "samples/rgb.img" "samples/recoded-rgb565.img" "RGB565" "no") -(img-recode "samples/rgb.img" "samples/recoded-rgba.img" "RGBA" "0x0F0") - -(gimp-quit 0) - diff --git a/test.scm b/test.scm new file mode 100644 index 0000000..113c443 --- /dev/null +++ b/test.scm @@ -0,0 +1,15 @@ +(define (img-recode srcfile destfile fmt ckey) + (let* ((image (car (file-img-load RUN-NONINTERACTIVE srcfile srcfile))) + (drawable (car (gimp-image-get-active-layer image)))) + (file-img-save RUN-NONINTERACTIVE image drawable destfile destfile fmt ckey))) + +(catch (gimp-quit 0) + (img-recode "samples/rgb.img" "samples/recoded-rgb-rgb565.img" "RGB565" "no") + (img-recode "samples/rgb.img" "samples/recoded-rgb-rgba.img" "RGBA" "0x0F0") + (img-recode "samples/rgb565.img" "samples/recoded-rgb565-rgb.img" "RGB" "") + (img-recode "samples/rgb565.img" "samples/recoded-rgb565-rgba.img" "RGBA" "(255, 255, 255)") + (img-recode "samples/rgba.img" "samples/recoded-rgba-rgb.img" "RGB" "no") + (img-recode "samples/rgba.img" "samples/recoded-rgba-rgb565.img" "RGB565" "no")) + +(with-output-to-file "samples/success" (lambda () (write "SUCCESS"))) +(gimp-quit 0) |