From 6ebc273959eb054964fa53fdaf7b382ab2f8672a Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 4 Jun 2007 16:18:32 +0000 Subject: [PATCH] applied patch from Saul Goode that enables Distress Selection for 2007-06-04 Sven Neumann * plug-ins/script-fu/scripts/distress-selection.scm: applied patch from Saul Goode that enables Distress Selection for grayscale images. svn path=/trunk/; revision=22706 --- ChangeLog | 5 +++++ .../script-fu/scripts/distress-selection.scm | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6300882a8a..38dd416430 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-04 Sven Neumann + + * plug-ins/script-fu/scripts/distress-selection.scm: applied patch + from Saul Goode that enables Distress Selection for grayscale images. + 2007-06-04 Michael Natterer * libgimpwidgets/gimpcolorscale.c (gimp_color_scale_expose): diff --git a/plug-ins/script-fu/scripts/distress-selection.scm b/plug-ins/script-fu/scripts/distress-selection.scm index 7d3cc5f10c..624cc3ae26 100644 --- a/plug-ins/script-fu/scripts/distress-selection.scm +++ b/plug-ins/script-fu/scripts/distress-selection.scm @@ -22,7 +22,7 @@ ; Define the function: (define (script-fu-distress-selection inImage - inLayer + inDrawable inThreshold inSpread inGranu @@ -35,14 +35,18 @@ (theWidth (car (gimp-image-width inImage))) (theHeight (car (gimp-image-height inImage))) (theLayer) + (theMode (car (gimp-image-base-type inImage))) ) (gimp-image-undo-group-start theImage) - + (if (= theMode GRAY) + (set! theMode GRAYA-IMAGE) + (set! theMode RGBA-IMAGE) + ) (set! theLayer (car (gimp-layer-new theImage theWidth theHeight - RGBA-IMAGE + theMode "Distress Scratch Layer" 100 NORMAL-MODE))) @@ -79,7 +83,10 @@ (plug-in-gauss-iir TRUE theImage theLayer 1 TRUE TRUE) (gimp-selection-layer-alpha theLayer) (gimp-image-remove-layer theImage theLayer) - + (if (and (= (car (gimp-drawable-is-channel inDrawable)) TRUE) + (= (car (gimp-drawable-is-layer-mask inDrawable)) FALSE)) + (gimp-image-set-active-channel theImage inDrawable) + ) (gimp-image-undo-group-end theImage) (gimp-displays-flush) @@ -93,7 +100,7 @@ "Chris Gutteridge" "1998, Chris Gutteridge / ECS dept, University of Southampton, England." "23rd April 1998" - "RGB*" + "RGB*,GRAY*" SF-IMAGE "The image" 0 SF-DRAWABLE "The layer" 0 SF-ADJUSTMENT _"Threshold (bigger 1<-->255 smaller)" '(127 1 255 1 10 0 0)