Gimp script-fu有时只工作

时间:2017-09-06 22:33:40

标签: scripting gimp

我不是真正精通图形的人之一,所以我在interwebz上发现了这个脚本,它有点碰壁了

(
define (script-fu-pcb-filter img)
(gimp-image-convert-grayscale img)
(gimp-image-flip img 1)
(gimp-image-resize img (* (cadr (cddr (gimp-selection-bounds 1))) 2) (* (caddr (cddr (gimp-selection-bounds 1))) 2) 0 0)
(gimp-layer-copy 2 1)
(gimp-image-add-layer img 3 0)
(gimp-layer-new img (cadr (cddr (gimp-selection-bounds 1))) (caddr (cddr (gimp-selection-bounds 1))) 2 "druhy" 100 0)
(gimp-image-add-layer img 4 0)
(gimp-edit-fill 4 2)
(gimp-image-lower-layer-to-bottom img 4)
(gimp-image-merge-down img 2 0)
(gimp-selection-all img)
(gimp-flip 5 0)
(gimp-floating-sel-anchor 6)
(gimp-selection-all img)
(gimp-flip 5 1)
(gimp-floating-sel-anchor 7)
(gimp-flip 3 1)
(gimp-image-merge-down img 3 0)
(gimp-convert-indexed img 0 3 0 FALSE FALSE "a")
(file-png-save 1 img 8 "/tmp/etch_eagle_export.png" "/tmp/etch_eagle_export.png" FALSE 9 FALSE FALSE FALSE TRUE FALSE)
)
(script-fu-register "script-fu-pcb-filter"
"PCB-Filter"
"Gets ready export image from egale ready for print"
"Anton Krug "
"Anton Krug"
"2009-04-25"
"RGB*, GRAY*, INDEXED*"
SF-IMAGE "Input Image" 0)

(script-fu-menu-register "script-fu-pcb-filter" "/Image/Eagle/")

它应该翻转图像并对其进行镜像,以便在一个页面(A4目的地)上获得相同图像的两个副本,并且图像应保留其原始比例,即不进行任何大小调整。然后将图像打印在透明胶片上并用于蚀刻pcb。

我将脚本保存在正确的文件夹中,当我使用干净的数据文件夹启动gimp时(在我的案例中为/home/foo/.gimp-2.8),脚本运行正常,一次。关闭第一张图像后,甚至在重新启动gimp后,我无法再次在另一张图像上运行该脚本。我必须删除gimp的数据文件夹并将其重新保存在脚本文件夹中,以便脚本再次运行。这有点超过脚本imho的目的所以我想知道为什么它现在按预期工作。有什么我想念的吗?

编辑:错误消息&附录 The error message

附录:当我从新的配置文件文件夹刷新脚本时,菜单项PCB-Filter显示2倍。我正在运行manjaro,这是arch linux的衍生产品,gimp -v给出了:

$ gimp -v
GNU Image Manipulation Program version 2.8.22
git-describe: GIMP_2_8_20-60-ge39a4e1203

using GEGL version 0.2.0 (compiled against version 0.2.0)
using GLib version 2.52.3 (compiled against version 2.52.2)
using GdkPixbuf version 2.36.8 (compiled against version 2.36.6)
using GTK+ version 2.24.31 (compiled against version 2.24.31)
using Pango version 1.40.9 (compiled against version 1.40.6)
using Fontconfig version 2.12.4 (compiled against version 2.12.3)
using Cairo version 1.14.10 (compiled against version 1.14.8)

此致

0 个答案:

没有答案