[Gimp-developer] is possible starting gimp script-fu server from command line ?

2003-03-02 Thread Valter Mazzola

If not, Can be added to gimp stable distribution asap ?

I need only the script-fu server and no interface, this is 
for high volume batch processing with gimp.


thanks,
Valter , Italy.
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] - Addit. Questions - perl-fu : cannot saveimage

2003-02-28 Thread Valter Mazzola
Your script is 
Perfect Raphaël !  


I've other questions:

1) When i run the script, i've a gimp window with the image created.

   I want to close it before leaving the script,

   I've done a (gimp-delete-image img) BUIT WITH NO effects.



2) Can i activate gimp with no visual interface at all AND the 
   script-fu server from the command line and but in in background under linux ?

thanks,
Valter.



On Thu, 27 Feb 2003 16:46:52 +0100
Raphaël Quinet <[EMAIL PROTECTED]> wrote:

> On Thu, 27 Feb 2003 14:37:36 +0100, Valter Mazzola <[EMAIL PROTECTED]> wrote:
> > Dear Raphaël
> > 
> > can you make an example script that calls a script-fu- logo scripts and save it?
> > 
> > for example this one doesn't save correctly the image: 
> > 
> > (begin
> >   (let* 
> >  (
> >  (image  (car (   (script-fu-alien-glow-logo "hello hello"  150 
> > "-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*"  '(255 0 0))))   )
> > ; (image (car (gimp-file-load 0 "/root/clock.gif" "/root/clock.gif")))
> >  (drawable  nil)
> >  )
> >
> >   (set! drawable  (car (gimp-image-flatten image)))
> >   (gimp-file-save 1 image drawable "/root/a.png" "/root/a.png")
> >   (gimp-image-delete image)
> >   ) ;let
> > )
> 
> There are a few problems in your script, such as the extra parenthesis before
> the call to script-fu-alien-glow-logo.  Also, one thing that is not really
> obvious is that the script returns one more than the index of the new image
> (don't ask me why).  So here is a modified version of the script that should
> work:
> 
> (define (script-fu-blahblah outfile)
>   (let* ((img (- (car (script-fu-alien-glow-logo "hello hello" 150 
> "-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*" '(255 0 0))) 1))
>(drawable (car (gimp-image-flatten img
> (gimp-convert-indexed img 1 0 255 0 1 "")
> (file-png-save 1 img drawable outfile outfile 0 9 0 0 0 0 0)))
> 
> You can also register this script in the menus:
> 
> (script-fu-register "script-fu-blahblah"
>   "/Xtns/Script-Fu/Blahblah"
>   "Blah blah blah!"
>   "me"
>   "me"
>   "2003-02-27"
>   ""
>   SF-FILENAME "Outfile" "outfile.png")
> 
> Or if you want to invoke it directly from the command line in batch mode,
> then you can replace the "(define ...)" with "(begin ...)" as you did in
> your example and directly replace the value of "outfile" with the name of
> the file in which you want to save the results.
> 
> -Raphaël
> ___
> Gimp-developer mailing list
> [EMAIL PROTECTED]
> http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


-- 
Valter Mazzola - Software/Databases for Enterprise Web Sites
  Java, Jsp, ASP, PHP, PERL, Mod_Perl, PL/SQL, Apache,IIS
  C/C++, Oracle, SQL Sever, PostgreSQL, MySQL, Access.
http://SitiDinamici.com/ 
Phone:(+39) 347/129-07-16.  Fax:(+39) 02/700-539-403
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] perl-fu : cannot save image

2003-02-27 Thread Valter Mazzola
Dear Raphaël

can you make an example script that calls a script-fu- logo scripts and save it?


for example this one doesn't save correctly the image: 

(begin
  (let* 
 (
 (image  (car (   (script-fu-alien-glow-logo "hello hello"  150 
"-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*"  '(255 0 0))))   )
; (image (car (gimp-file-load 0 "/root/clock.gif" "/root/clock.gif")))
 (drawable  nil)
 )
   
  (set! drawable  (car (gimp-image-flatten image)))
  (gimp-file-save 1 image drawable "/root/a.png" "/root/a.png")
  (gimp-image-delete image)
  ) ;let
  
)



thanks,
valter


On Thu, 27 Feb 2003 14:04:51 +0100
Raphaël Quinet <[EMAIL PROTECTED]> wrote:

> On Wed, 26 Feb 2003 22:24:13 +0100, Valter Mazzola <[EMAIL PROTECTED]> wrote:
> > ok but io want to create logos using existing script-fu logo script?
> >  it's possible 
> 
> Yes.  One solution that does work with the current and future versions
> of the GIMP is to write your whole script in Script-Fu.  Do not try to
> call Script-Fu from Perl (or from any other plug-in, for that matter)
> because you will not get the expected results.  Instead, write everything
> in Script-Fu and you will get your logo as expected.
> 
> Note that I am not engaging in any kind of Perl-bashing here: Perl is my
> language of choice whenever I have to write some scripts or even some
> rather complex programs.  But as it stands currently, Gimp-Perl has some
> problems (some of them inherited from Gtk-Perl bugs on some platforms,
> some others due to the build/install process and some others due to the
> fact that it is not maintained anymore) and will probably not be included
> in the next release of the GIMP.  So although Perl is a fine language,
> the safest solution for the moment is to use Script-Fu, which is less
> powerful but works well with the current and future versions of the GIMP.
> 
> The bug report describing the incorrect behavior of Script-Fu when called
> from other plug-ins can be found here:
>   http://bugzilla.gnome.org/show_bug.cgi?id=50649
> 
> So the short but confusing conclusion is:
> - Script-Fu is broken (bug #50649)
> - Gimp-Perl is broken and is not maintained
> - The problem you see is mainly due to the script-fu bug mentioned above
>   and not to a problem in Perl, but the best solution is to use Script-Fu
>   only.
> 
> -Raphaël
> ___
> Gimp-developer mailing list
> [EMAIL PROTECTED]
> http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


-- 
Valter Mazzola - Software/Databases for Enterprise Web Sites
  Java, Jsp, ASP, PHP, PERL, Mod_Perl, PL/SQL, Apache,IIS
  C/C++, Oracle, SQL Sever, PostgreSQL, MySQL, Access.
http://SitiDinamici.com/ 
Phone:(+39) 347/129-07-16.  Fax:(+39) 02/700-539-403
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Re: Error in Script-fu !

2003-02-27 Thread Valter Mazzola
On Wed, 26 Feb 2003 19:22:32 -0500
Carol Spears <[EMAIL PROTECTED]> wrote:

> On 2003-02-26 at 2143.29 +0100, Branko Collin typed this:
> > On 26 Feb 2003, at 10:30, Valter Mazzola wrote:
> > 
> > > i'm executing this line in gimp 1.2.3 Script-Console , linux Mandrake
> > > 9.0 intel:
> > > 
> > > =>  (script-fu-alien-glow-logo  0  "hello"  "150"
> > > "-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*"  '(255 0 0)  ) 
> > > 
> > > the console gives:
> > > 
> > > ERROR: wta(1st) to quotient (errobj hello)
> > 
> > I don't know, it looks like it should work, but it doesn't.
> > 
> i wonder where you got your fonts from.  utopia is missing from the
> sharefonts i got from debian.  

I don't remeber precisely...
>From Mandrake 9.0 itsel or imported from Win with mandrake tool.


> 
> carol
> 
> ___
> Gimp-developer mailing list
> [EMAIL PROTECTED]
> http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


-- 
Valter Mazzola - Software/Databases for Enterprise Web Sites
  Java, Jsp, ASP, PHP, PERL, Mod_Perl, PL/SQL, Apache,IIS
  C/C++, Oracle, SQL Sever, PostgreSQL, MySQL, Access.
http://SitiDinamici.com/ 
Phone:(+39) 347/129-07-16.  Fax:(+39) 02/700-539-403
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


[Gimp-developer] Script-Fu : ERROR: bad function (see errobj)

2003-02-26 Thread Valter Mazzola
Try to generate a script-fu-alien-glow-logo and save it to /root/a.png i get the error

ERROR: bad function (see errobj)

if i replace:   (image  (car (   (script-fu-alien-glow-logo "hello hello"  150 
"-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*"  '(255 0 0))))   )
with :  (image (car (gimp-file-load 0 "/root/clock.gif" 
"/root/clock.gif"))), the saved image is ok.


Valter

---

(begin
  (let* 
 (
 (image  (car (   (script-fu-alien-glow-logo "hello hello"  150 
"-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*"  '(255 0 0))))   )
; (image (car (gimp-file-load 0 "/root/clock.gif" "/root/clock.gif")))
 (drawable  nil)
 )
   
  (set! drawable  (car (gimp-image-flatten image)))
  (gimp-file-save 1 image drawable "/root/a.png" "/root/a.png")
  (gimp-image-delete image)
  ) ;let  
)


___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] perl-fu : cannot save image

2003-02-26 Thread Valter Mazzola
i'm using mandrake 9.0 and gimp 1.2.3 , removed mail() in exit, 
but the saved logo is totally different than the gimp do interactively.


>The only solution is to avoid script-fu whereever possible. It has been
>horribly buggy since many years (I don't remember it being working
>ever). But obviously it's much more fun to blame gimp-perl for bugs in
>script-fu, or claim thats cript-fu was never written to be used as a
>gimp-plug-in, or other fun stuff.

ok but io want to create logos using existing script-fu logo script?
 it's possible 

I want to do serious scripting work with gimp, similar to   cool text.com,
can you help me to decide in what direction i should go ?

I have not obtained deterministic results till now. 

Script-fu, perl-fu , interactions between them, outdated documentations ???


--

use Gimp ":auto";
use Gimp::Fu;
use strict;

sub net {
}

Gimp::init;
Gimp::on_net(\&net);

Gimp::set_trace (TRACE_ALL);

my $i=0;

system ("rm -f image_1.png");


script_fu_alien_glow_logo("hello hello $i", "150", 
"-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*", [255,0,0] );

my $img = &gimp_image_list();

my $fname = "image_1.png";
my $activelayer= &gimp_image_flatten($img);


file_png_save(RUN_NONINTERACTIVE, $img, $activelayer,   
$fname, $fname, 0, 9, 0, 0, 0, 0, 0);

# Handle over control to gimp

exit; 



On Wed, 26 Feb 2003 19:29:43 +0100
<[EMAIL PROTECTED] ( Marc) (A.) (Lehmann )> wrote:

> On Thu, Feb 20, 2003 at 12:11:29AM +0100, Valter Mazzola <[EMAIL PROTECTED]> wrote:
> > Hello  Marc , i want to automate logo creation
> > with the script 
> > 
> > exit main();
> 
> That's the problem. If you use Gimp::init then you should not call main.
> 
> -- 
>   -==- |
>   ==-- _   |
>   ---==---(_)__  __   __   Marc Lehmann  +--
>   --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED]  |e|
>   -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
> The choice of a GNU generation   |
>  |


-- 
Valter Mazzola - Software/Databases for Enterprise Web Sites
  Java, Jsp, ASP, PHP, PERL, Mod_Perl, PL/SQL, Apache,IIS
  C/C++, Oracle, SQL Sever, PostgreSQL, MySQL, Access.
http://SitiDinamici.com/ 
Phone:(+39) 347/129-07-16.  Fax:(+39) 02/700-539-403





On Wed, 26 Feb 2003 19:46:43 +0100
<[EMAIL PROTECTED] ( Marc) (A.) (Lehmann )> wrote:

> On Mon, Feb 24, 2003 at 06:38:42PM +0100, Sven Neumann <[EMAIL PROTECTED]> wrote:
> > I'd say the bug is in your script. But then you could argue that the
> > bug is in gimp-perl since it's syntax defers from the one that is
> > documented :-(
> 
> I would prefer if people who could know it better would stop claiming such
> bullshit. The perl-syntax is well-documented, and even if you insist on
> using the rather idiotic PDB-syntax, it does work.
> 
> Also, it should be clear even to you that some languages look diferent
> to others. I remember that a PDB call uses different syntax in C than in
> script-fu, for example.
> 
> Yes, both might be documented, and the same is true for the perl
> interface. Since you certainly _are_ aware of all that, what's your point?
> 
> Maybe I should add dummy array-length arguments to all calls involving
> arrays, because other languages can't handle that?
> 
> > >   file_png_save(RUN_NONINTERACTIVE, $img, $activelayer,   
> > > $fname, $fname, 0, 9, 0, 0, 0, 0, 0);
> > 
> > in gimp-perl, you need to omit the image if the drawable
> > ($activelayer) is already specified.
> 
> Actually, you don't. Actually, the script works fine on a standard debian
> installation (gimp-1.2 1.2.3-2, with the debian gimp-pelr etc..), WHEN I
> add sleeps at the right place.
> 
> What's buggy is, again, script-fu, which returns long before the script
> has run. And the script doesn't work unless you create another image,
> because it doesn't like image ids of zero.
> 
> The only solution is to avoid script-fu whereever possible. It has been
> horribly buggy since many years (I don't remember it being working
> ever). But obviously it's much more fun to blame gimp-perl for bugs in
> script-fu, or claim thats cript-fu was never written to be used as a
> gimp-plug-in, or other fun stuff.
> 
> Boys, I am really fed up with that never-ending and mindless
> perl-bashing. If you can't try to help people without shoveling mist

[Gimp-developer] perl-fu : cannot save image

2003-02-24 Thread Valter Mazzola


This script isn't able to save correctly the logo in png format, i've tried othe 
formats but seesm there are
 bug in gimp.

I'm using GIMP version 1.2.3, Mandrake Linux 9.0.

thanks,
valter

--
#!/usr/local/bin/perl

use Gimp ":auto";
use Gimp::Fu;
use strict;

sub net {
}

Gimp::init;
Gimp::on_net(\&net);

Gimp::set_trace (TRACE_ALL);

my $i=0;

system ("rm -f image_1.png");


script_fu_alien_glow_logo("hello hello $i", "150", 
"-*-utopia-bold-r-*-*-150-*-*-*-*-*-*-*", [255,0,0] );

my $img = &gimp_image_list();

my $fname = "image_1.png";
my $activelayer= &gimp_image_flatten($img);


file_png_save(RUN_NONINTERACTIVE, $img, $activelayer,   
$fname, $fname, 0, 9, 0, 0, 0, 0, 0);

# Handle over control to gimp

exit main();


-- 
Valter 
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer