02-11-2018, 09:57 PM
I'm writing a plugin to call python-fu-heal-selection with inputs of the file and the points defining the polygon selection, but cannot get the polygon selection to work. I have tried using the square polygon select and it works fine, but the generic polygon selection does not accept my input; what's wrong with my script?
With the command line input:
I have tried removing '(define path-points (list->vector points))' and passed it the points as #(1 2 3 4) and still get an error message hinting at the fact that the polygon isn't closed or is empty.
Code:
(define
(heal-select points point_count)
(let*
(
(image (car (gimp-file-load RUN-NONINTERACTIVE "tmp.jpg" "tmp.jpg")))
(active-layer (car (gimp-image-get-active-layer image)))
)
;(gimp-image-select-rectangle image CHANNEL-OP-ADD 122 67 138 81)
(set! active-layer (car (gimp-image-get-active-layer image)))
(define path-points (list->vector points))
(gimp-image-select-polygon image CHANNEL-OP-ADD point_count path-points)
(python-fu-heal-selection RUN-NONINTERACTIVE
image
active-layer
3
0
1)
(display points)
(gimp-file-save RUN-NONINTERACTIVE image active-layer "tmp2.jpg" "tmp2.jpg")
(gimp-image-delete image)
)
)
With the command line input:
Code:
gimp -i -b "(heal-select '(122. 67. 138. 67. 138. 81. 122. 81. 122. 67.) 5)" -b "(gimp-quit 0)"
I have tried removing '(define path-points (list->vector points))' and passed it the points as #(1 2 3 4) and still get an error message hinting at the fact that the polygon isn't closed or is empty.