[gimp] Applied modified version of first patch for bug #642939. Original patch supplied by Nelson A. de Oli



commit 403630fd5799c68cad1330289d457ea8f5f7ed47
Author: Kevin Cozens <kcozens cvs gnome org>
Date:   Wed Mar 2 02:21:50 2011 -0500

    Applied modified version of first patch for bug #642939.
    Original patch supplied by Nelson A. de Oliveira. Modified to not use the
    -1 "insanity" for invalid/none layer ID's in scripts per IRC discussion.

 plug-ins/script-fu/scripts/camo.scm     |   15 +++++++--------
 plug-ins/script-fu/scripts/circuit.scm  |   10 +---------
 plug-ins/script-fu/scripts/land.scm     |    6 +++---
 plug-ins/script-fu/scripts/tileblur.scm |    8 +++++---
 4 files changed, 16 insertions(+), 23 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/camo.scm b/plug-ins/script-fu/scripts/camo.scm
index 1b1faba..8347e40 100644
--- a/plug-ins/script-fu/scripts/camo.scm
+++ b/plug-ins/script-fu/scripts/camo.scm
@@ -32,30 +32,29 @@
 
     (gimp-context-push)
 
-    (gimp-image-insert-layer theImage baseLayer 0)
+    (gimp-image-insert-layer theImage baseLayer 0 0)
 
     (set! thickLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Camo Thick Layer" 100 NORMAL-MODE)))
-    (gimp-image-insert-layer theImage thickLayer 0)
+    (gimp-image-insert-layer theImage thickLayer 0 0)
 
     (set! thinLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Camo Thin Layer" 100 NORMAL-MODE)))
-    (gimp-image-insert-layer theImage thinLayer 0)
+    (gimp-image-insert-layer theImage thinLayer 0 0)
 
     (gimp-selection-all theImage)
     (gimp-context-set-background inColor1)
     (gimp-drawable-fill baseLayer BACKGROUND-FILL)
 
     (plug-in-solid-noise RUN-NONINTERACTIVE
-			 theImage thickLayer 1 0 (rand 65536) 1 inGrain inGrain)
+        theImage thickLayer 1 0 (rand 65536) 1 inGrain inGrain)
     (plug-in-solid-noise RUN-NONINTERACTIVE
-			 theImage thinLayer 1 0 (rand 65536) 1 inGrain inGrain)
+        theImage thinLayer 1 0 (rand 65536) 1 inGrain inGrain)
     (gimp-threshold thickLayer 127 255)
     (gimp-threshold thinLayer 145 255)
 
     (set! theBlur (- 16 inGrain))
 
     (gimp-context-set-background inColor2)
-    (gimp-by-color-select thickLayer
-			  '(0 0 0) 127 CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
+    (gimp-image-select-color theImage CHANNEL-OP-REPLACE thickLayer '(0 0 0))
     (gimp-edit-clear thickLayer)
     (gimp-selection-invert theImage)
     (gimp-edit-fill thickLayer BACKGROUND-FILL)
@@ -66,7 +65,7 @@
 
 
     (gimp-context-set-background inColor3)
-    (gimp-by-color-select thinLayer '(0 0 0) 127 CHANNEL-OP-REPLACE  TRUE FALSE 0 FALSE)
+    (gimp-image-select-color theImage CHANNEL-OP-REPLACE thinLayer '(0 0 0))
     (gimp-edit-clear thinLayer)
     (gimp-selection-invert theImage)
     (gimp-edit-fill thinLayer BACKGROUND-FILL)
diff --git a/plug-ins/script-fu/scripts/circuit.scm b/plug-ins/script-fu/scripts/circuit.scm
index 9ed5143..d730c64 100644
--- a/plug-ins/script-fu/scripts/circuit.scm
+++ b/plug-ins/script-fu/scripts/circuit.scm
@@ -112,15 +112,7 @@
          (= remove-bg TRUE)
          (= separate-layer TRUE))
         (begin
-          (gimp-by-color-select
-           active-layer
-           '(0 0 0)
-           15
-           2
-           TRUE
-           FALSE
-           10
-           FALSE)
+          (gimp-image-select-color image CHANNEL-OP-REPLACE active-layer '(0 0 0))
           (gimp-edit-clear active-layer)))
 
     (if (= keep-selection FALSE)
diff --git a/plug-ins/script-fu/scripts/land.scm b/plug-ins/script-fu/scripts/land.scm
index ef48a77..ea84e08 100644
--- a/plug-ins/script-fu/scripts/land.scm
+++ b/plug-ins/script-fu/scripts/land.scm
@@ -38,19 +38,19 @@
         )
   (gimp-context-set-gradient gradient)
   (gimp-image-undo-disable img)
-  (gimp-image-add-layer img layer-one 0)
+  (gimp-image-insert-layer img layer-one 0 0)
 
   (plug-in-solid-noise RUN-NONINTERACTIVE img layer-one TRUE FALSE seed detail xscale yscale)
   (plug-in-c-astretch RUN-NONINTERACTIVE img layer-one)
   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
-  (gimp-image-add-layer img layer-two -1)
+  (gimp-image-insert-layer img layer-two 0 -1)
   (gimp-image-set-active-layer img layer-two)
 
   (plug-in-gradmap RUN-NONINTERACTIVE img layer-two)
 
 
 
-  (gimp-by-color-select layer-one '(190 190 190) 55 CHANNEL-OP-REPLACE FALSE FALSE 0 FALSE)
+  (gimp-image-select-color img CHANNEL-OP-REPLACE layer-one '(190 190 190))
   (plug-in-bump-map RUN-NONINTERACTIVE img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
 
   ;(plug-in-c-astretch RUN-NONINTERACTIVE img layer-two)
diff --git a/plug-ins/script-fu/scripts/tileblur.scm b/plug-ins/script-fu/scripts/tileblur.scm
index 21a5535..41abde4 100644
--- a/plug-ins/script-fu/scripts/tileblur.scm
+++ b/plug-ins/script-fu/scripts/tileblur.scm
@@ -34,7 +34,9 @@
     (gimp-image-undo-group-start theImage)
     (gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0)
 
-    (gimp-rect-select theImage 0 0 theWidth theHeight CHANNEL-OP-REPLACE 0 0)
+    (gimp-context-set-feather 0)
+    (gimp-context-set-feather-radius 0 0)
+    (gimp-image-select-rectangle theImage CHANNEL-OP-REPLACE 0 0 theWidth theHeight)
     (gimp-edit-cut theLayer)
 
     (gimp-selection-none theImage)
@@ -47,9 +49,9 @@
     (gimp-selection-none theImage)
     (if (= inType 0)
         (plug-in-gauss-iir RUN-NONINTERACTIVE
-			   theImage theLayer inRadius inHoriz inVert)
+                           theImage theLayer inRadius inHoriz inVert)
         (plug-in-gauss-rle RUN-NONINTERACTIVE
-			   theImage theLayer inRadius inHoriz inVert)
+                           theImage theLayer inRadius inHoriz inVert)
     )
 
     (gimp-layer-resize theLayer



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]