[Gimp-developer] [PATCH] Fix some errors and usage of deprecated procedures

2011-02-22 Thread Nelson A. de Oliveira
Hi!

While running the camouflage pattern plugin I saw an error:

=
Error while executing script-fu-camo-pattern:
Error: ( : 1) Invalid number of arguments for gimp-image-insert-layer
(expected 4 but received 3)
=

The attached patch fix this (and also fix the usage of some deprecated
procedures).

Thank you!

Best regards,
Nelson
From 957448bd30ca612b0a291aec722576ac363105f7 Mon Sep 17 00:00:00 2001
From: Nelson A. de Oliveira nao...@debian.org
Date: Tue, 22 Feb 2011 08:42:18 -0300
Subject: [PATCH] Fix some errors and usage of deprecated procedures

---
 plug-ins/script-fu/scripts/camo.scm|   11 +--
 plug-ins/script-fu/scripts/circuit.scm |   10 +-
 plug-ins/script-fu/scripts/land.scm|6 +++---
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/plug-ins/script-fu/scripts/camo.scm b/plug-ins/script-fu/scripts/camo.scm
index 1b1faba..4c4311b 100644
--- a/plug-ins/script-fu/scripts/camo.scm
+++ b/plug-ins/script-fu/scripts/camo.scm
@@ -32,13 +32,13 @@
 
 (gimp-context-push)
 
-(gimp-image-insert-layer theImage baseLayer 0)
+(gimp-image-insert-layer theImage baseLayer -1 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 -1 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 -1 0)
 
 (gimp-selection-all theImage)
 (gimp-context-set-background inColor1)
@@ -54,8 +54,7 @@
 (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..a30ca2b 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 2 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..cd9d8c1 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 -1 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 -1 -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)
-- 
1.7.2.3

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] [PATCH] Fix some errors and usage of deprecated procedures

2011-02-22 Thread Carol Spears
On Tue, Feb 22, 2011 at 11:47:58AM +, Nelson A. de Oliveira wrote:
 Hi!
 
 While running the camouflage pattern plugin I saw an error:
 
 =
 Error while executing script-fu-camo-pattern:
 Error: ( : 1) Invalid number of arguments for gimp-image-insert-layer
 (expected 4 but received 3)
 =
 
 The attached patch fix this (and also fix the usage of some deprecated
 procedures).
 
circuit.scm was repaired very recently (38 hours ago) in GIMP's git tree:
http://git.gnome.org/browse/gimp/commit/?id=b19645db4954a8fc8db83817dc7cd2e45e840efb
 along with a few others.

i recently opened a bug report with some patches for this same kind of 
updates to different script-fus: 
https://bugzilla.gnome.org/show_bug.cgi?id=642939
if you would like to put your patches there, it might be easier for whoever
to get them from there when the time is right or whatever has to happen for
scripts to be updated.

if i remember correctly, commit permission is a privelege more than a ticket
to ride, or whatever

and thanks, if no one else does this, i will be glad to apply them to my 
copy.

carol

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] [PATCH] Fix some errors and usage of deprecated procedures

2011-02-22 Thread Nelson A. de Oliveira
Hi!

On Tue, Feb 22, 2011 at 12:25 PM, Carol Spears ca...@gimp.org wrote:
 circuit.scm was repaired very recently (38 hours ago) in GIMP's git tree:
 http://git.gnome.org/browse/gimp/commit/?id=b19645db4954a8fc8db83817dc7cd2e45e840efb
  along with a few others.

I saw it! :-)
My patch only replaces the deprecated gimp-by-color-select by
gimp-image-select-color (that isn't included in b19645d)

 i recently opened a bug report with some patches for this same kind of
 updates to different script-fus:
 https://bugzilla.gnome.org/show_bug.cgi?id=642939
 if you would like to put your patches there, it might be easier for whoever
 to get them from there when the time is right or whatever has to happen for
 scripts to be updated.

Included two patches there.

Thank you!

Best regards,
Nelson
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer