here is the finished code I wrote and tested OK, I used a previous version to test
examples of use are below
(gc-shadow-add-layer img shadow-layer in-layer 0)= add above
(gc-shadow-add-layer img shadow-layer in-layer 1)= add below
I placed the routine at the top as a convenience if adding additional layers
; ------------
;| Change Log |
; ------------
; RC V0.1 - Initial Release Candidate
; RC V0.2 - Fix Gausian limits, Merge visible layers, Clear script's selections on exit
; RV V0.3 - Resize shadow layer to compensate for shadow offset, blur & feather
; Allow resize option, Correct shadow X & Y mininum limits
;
;
;
;
; GC Shadow Add layer Procedure
(define (gc-shadow-add-layer image newlayer oldlayer stack) ;stack=0 'above stack=1 ;below
(cond ((defined? 'gimp-image-get-item-position) ;test for 2.8 compatability
(gimp-image-insert-layer image newlayer (car (gimp-item-get-parent oldlayer))
(+ (car (gimp-image-get-layer-position image oldlayer)) stack)) ;For GIMP 2.8
)
(else
(gimp-image-add-layer image newlayer (+ (car (gimp-image-get-layer-position image oldlayer)) stack)) ;For GIMP 2.6
)
) ;end cond
) ;end add layer procedure;
; Define GC Shadow Procedure
;
(define (script-fu-gc-shadow
img ; Image in which to apply procedure
in-layer ; Layer used to create shadowto
shadow-name ; Shadow Name
shadow-color ; Shadow Color
shadow-opacity ; Shadow Opacity
shadow-feather ; Feather Shadow Amount
shadow-blur-radiusx ; Blur Radius
shadow-blur-radiusy ; Blur Radius
shadow-blur-method ; Shadow Blur Method
shadow-offsetx ; Shadow Offset X
shadow-offsety ; Shadow Offset Y
inner-shadow-toggle ; Inner Shadow Toggle
glow-toggle ; Glow Toggle
merge-visible-layers ; Merge Visible layers Toggle
allow-resize ; Resize toggle
)
(let* (
(shadow-layer -1) ; Shadow layer
(saved-selection -1) ; Save Selection Variable
(new-image-height -1) ; New Image Height
(radiusx-value -1) ; Varibale to hold radiusx for resize
(radiusy-value -1) ; Varibale to hold radiusy for resize
(new-image-width -1) ; New Image Width
(selection-empty -1) ; Incoming Selection Flag
(layer-name (car (gimp-drawable-get-name in-layer)))
)
;
; Save current GIMP context
;
(gimp-context-push) ; Push context onto stack
(gimp-image-undo-group-start img) ; Begin undo group
(set! selection-empty (car (gimp-selection-is-empty img))) ; Incoming Selection Flag
(set! shadow-layer (car (gimp-layer-new-from-drawable in-layer img))) ; New Shadow Layer
(gc-shadow-add-layer img shadow-layer in-layer 0) ;add above
_________________

No matter how much you push the envelope, it'll still be stationery.