| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/gimp/2.0/scripts/ |
Upload File : |
;; -*-scheme-*-
(define (script-fu-guides-from-selection image drawable)
(let* (
(boundaries (gimp-selection-bounds image))
;; non-empty INT32 TRUE if there is a selection
(selection (car boundaries))
(x1 (cadr boundaries))
(y1 (caddr boundaries))
(x2 (cadr (cddr boundaries)))
(y2 (caddr (cddr boundaries)))
)
;; need to check for a selection or we get guides right at edges of the image
(if (= selection TRUE)
(begin
(gimp-image-undo-group-start image)
(gimp-image-add-vguide image x1)
(gimp-image-add-hguide image y1)
(gimp-image-add-vguide image x2)
(gimp-image-add-hguide image y2)
(gimp-image-undo-group-end image)
(gimp-displays-flush)
)
)
)
)
(script-fu-register "script-fu-guides-from-selection"
_"New Guides from _Selection"
_"Create four guides around the bounding box of the current selection"
"Alan Horkan"
"Alan Horkan, 2004. Public Domain."
"2004-08-13"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
(script-fu-menu-register "script-fu-guides-from-selection"
"<Image>/Image/Guides")