first resize the image, then add the border layer and then fill it

2004-11-21  Michael Schumacher <schumaml@cvs.gnome.org>

	* plug-ins/script-fu/scripts/addborder.scm: first resize the
	image, then add the border layer and then fill it
This commit is contained in:
Michael Schumacher 2004-11-21 10:12:36 +00:00 committed by Michael Schumacher
parent 3d85bbe33f
commit a31104356e
2 changed files with 58 additions and 52 deletions

View File

@ -1,3 +1,8 @@
2004-11-21 Michael Schumacher <schumaml@cvs.gnome.org>
* plug-ins/script-fu/scripts/addborder.scm: first resize the
image, then add the border layer and then fill it
2004-11-20 Kevin Cozens <kcozens@cvs.gimp.org>
* plug-ins/script-fu/script-fu-scripts.c: Need to call gettext in

View File

@ -97,14 +97,14 @@
(define (script-fu-addborder aimg adraw xsize ysize colour dvalue)
(let* ((img (car (gimp-drawable-get-image adraw)))
(owidth (car (gimp-image-width img)))
(oheight (car (gimp-image-height img)))
(width (+ owidth (* 2 xsize)))
(height (+ oheight (* 2 ysize)))
(layer (car (gimp-layer-new img
width height
(car (gimp-drawable-type-with-alpha adraw))
"Border-Layer" 100 NORMAL-MODE))))
(owidth (car (gimp-image-width img)))
(oheight (car (gimp-image-height img)))
(width (+ owidth (* 2 xsize)))
(height (+ oheight (* 2 ysize)))
(layer (car (gimp-layer-new img
width height
(car (gimp-drawable-type-with-alpha adraw))
"Border-Layer" 100 NORMAL-MODE))))
;Add this for debugging (verbose 4)
@ -112,50 +112,51 @@
(gimp-image-undo-group-start img)
(gimp-drawable-fill layer TRANSPARENT-FILL)
(gimp-image-add-layer img layer 0)
(gimp-image-resize img
width
height
xsize
ysize)
width
height
xsize
ysize)
(gimp-image-add-layer img layer 0)
(gimp-drawable-fill layer TRANSPARENT-FILL)
(gimp-context-set-background (adjcolour colour dvalue))
(gimp-free-select img
10
(gen_top_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
10
(gen_top_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
(gimp-edit-fill layer BACKGROUND-FILL)
(gimp-context-set-background (adjcolour colour (/ dvalue 2)))
(gimp-free-select img
10
(gen_left_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
10
(gen_left_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
(gimp-edit-fill layer BACKGROUND-FILL)
(gimp-context-set-background (adjcolour colour (- 0 (/ dvalue 2))))
(gimp-free-select img
10
(gen_right_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
10
(gen_right_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
(gimp-edit-fill layer BACKGROUND-FILL)
(gimp-context-set-background (adjcolour colour (- 0 dvalue)))
(gimp-free-select img
10
(gen_bottom_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
10
(gen_bottom_array xsize ysize owidth oheight width height)
CHANNEL-OP-REPLACE
0
0
0.0)
(gimp-edit-fill layer BACKGROUND-FILL)
(gimp-selection-none img)
@ -165,18 +166,18 @@
(gimp-context-pop)))
(script-fu-register "script-fu-addborder"
_"Add _Border..."
"Add a border around an image"
"Andy Thomas <alt@picnic.demon.co.uk>"
"Andy Thomas"
"6/10/97"
"*"
SF-IMAGE "Input image" 0
SF-DRAWABLE "Input drawable" 0
SF-ADJUSTMENT _"Border X size" '(12 1 250 1 10 0 1)
SF-ADJUSTMENT _"Border Y size" '(12 1 250 1 10 0 1)
SF-COLOR _"Border color" '(38 31 207)
SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1))
_"Add _Border..."
"Add a border around an image"
"Andy Thomas <alt@picnic.demon.co.uk>"
"Andy Thomas"
"6/10/97"
"*"
SF-IMAGE "Input image" 0
SF-DRAWABLE "Input drawable" 0
SF-ADJUSTMENT _"Border X size" '(12 1 250 1 10 0 1)
SF-ADJUSTMENT _"Border Y size" '(12 1 250 1 10 0 1)
SF-COLOR _"Border color" '(38 31 207)
SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1))
(script-fu-menu-register "script-fu-addborder"
_"<Image>/Script-Fu/Decor")
_"<Image>/Script-Fu/Decor")