Re: Re: [Gimp-developer] start perl server

2004-07-07 Thread kovzol
On Thu, 17 Jun 2004, Seth Burgess wrote:

 I'd recommend putting the call inside an 'eval' block, so that it
 failing doesn't stop the execution of the script.

Sorry, I'm here again... ;-)

If I run the attached script without parameters, then I can see that gimp
appears and I can generate my needed image. But with parameters (without
the appearing gimp window), I get the following:

[EMAIL PROTECTED]:/home/wmi/cvs/wmi/ui ./oval-0707.pl -output_file FILENAME \
-font_size_pixels 11 -text_string TEXT
oval-buttons.pl: gimp_text_get_extents_fontname: procedural database
execution failed at ./oval-buttons.pl line 64 (DIE)

I cannot 'eval' it out, because I need the data captured in line 64.

Could you please help?

TIA, Zoltan


oval-0707.pl
Description: Perl program
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: Re: [Gimp-developer] start perl server (Simon Budig)

2004-06-18 Thread kovzol
 Make sure that the text passed to the Gimp is in the UTF-8 encoding.
 Gimp is quite strict about that.

 Bye,
 Simon
 --
   [EMAIL PROTECTED]  http://simon.budig.de/

Thanks, it works now perfectly. :-)

Zoltan

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


Re: Re: [Gimp-developer] start perl server

2004-06-17 Thread kovzol
On 17 Jun 2004, Sven Neumann wrote:

 Hi,

 kovzol [EMAIL PROTECTED] writes:

  Illegal default font description for perl_fu_mysite_buttons: -*-luxi
  sans-medium-r-*-*-24-*-*-*-*-*-iso8859-2

 GIMP doesn't use X Logical Font Descriptors any longer, so please
 change this to Sans Medium.

Thank you for your help! I changed this to the needed font. The only
problem is if I want to use accented letters, I run into an error:

[EMAIL PROTECTED]:~/cvs/wmi/ui ./oval-buttons.pl -font_size_pixels 11 -text_string
This works.
[EMAIL PROTECTED]:~/cvs/wmi/ui ./oval-buttons.pl -font_size_pixels 11 -text_string
Unmglich.
oval-buttons.pl: gimp_text_get_extents_fontname: procedural database
execution failed at ./oval-buttons.pl line 64 (DIE)

By the way, why must I define font_size_pixels? Without it I get into
another error:

[EMAIL PROTECTED]:~/cvs/wmi/ui ./oval-buttons.pl -text_string Unmglich
oval-buttons.pl: Unable to convert a reference to type 'FLOAT' at
./oval-buttons.pl line 64 (DIE)

  oval-buttons.pl: Expected an INT32 but got 'BG_IMAGE_FILL'. Add '*1' if
  you really intend to pass in a string at ./oval-buttons.pl line 110 (DIE)

 Please update your enums, this should be BACKGROUND_FILL instead of
 BG_IMAGE_FILL. Have a look at gimpcompat.h that documents these
 changes.

Sometimes it helps, sometimes not. Sorry to say, but I didn't find an
accurate, updated, fresh documentation about the syntax of the Gimp-Perl
(2.0) statements. Is there any?

A last note: I didn't even have to run Perl-Server within Gimp to run my
script reasonably fast:

[EMAIL PROTECTED]:~/cvs/wmi/ui time ./oval-buttons.pl -font_size_pixels 11 
-text_string
Fast

real0m0.609s
user0m0.080s
sys 0m0.000s

Congratulations for this speedup (it's about 7 times faster than
gimp-1.2.5 did)! However, server mode run fails on gimp_display_new():

[EMAIL PROTECTED]:~/cvs/wmi/ui gimp -i -b '(extension-perl-server 0 0 0)'
[1] 2633
[EMAIL PROTECTED]:~/cvs/wmi/ui 1087502556: server version 2 started
1087502556: accepting connections on
/tmp/gimp-perl-serv-uid-503/gimp-perl-serv
[EMAIL PROTECTED]:~/cvs/wmi/ui ./oval-buttons.pl -font_size_pixels 11 -text_string 
Fast
1087502561: accepted unix connection
oval-buttons.pl: gimp_display_new: procedural database execution failed at
./oval-buttons.pl line 144 (DIE)
[Invalid UTF-8] Kiszolgl: oval-buttons.pl: gimp_display_new: procedural
database execution failed at ./oval-buttons.pl line 144 (DIE)

[EMAIL PROTECTED]:~/cvs/wmi/ui 1087502561: closing connection 9 (136 requests in 0
seconds)

Am I using gimp_display_new() in a wrong way? But during standalone run it
works well... Why?


TIA, Zoltan

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


Re: Re: [Gimp-developer] start perl server

2004-06-17 Thread kovzol
 [Invalid UTF-8] Kiszolgl: oval-buttons.pl: gimp_display_new: procedural
 database execution failed at ./oval-buttons.pl line 144 (DIE)

 [EMAIL PROTECTED]:~/cvs/wmi/ui 1087502561: closing connection 9 (136 requests in 0
 seconds)

 Am I using gimp_display_new() in a wrong way? But during standalone run it
 works well... Why?

If I cut lines 144 and 145, then it works OK:

[EMAIL PROTECTED]:~/cvs/wmi/ui time ./oval-buttons.pl -font_size_pixels 11
-text_string Fast
1087503061: accepted unix connection
1087503061: closing connection 9 (133 requests in 0 seconds)

real0m0.132s
user0m0.090s
sys 0m0.000s

This is really nice (another 4 times of speedup). However, it would be
great if I will be able to decide if gimp_display_new() is prohibited to
run or not (within the script), i.e. to know if my script was called
without any parameters.

TIA, Zoltan

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


Re: Re: [Gimp-developer] start perl server

2004-06-17 Thread kovzol
 Am I using gimp_display_new() in a wrong way? But during standalone run it
 works well... Why?

I forgot to attach the current version of the script. Maybe this can give
additional information.

Zoltan


oval-buttons.pl
Description: Perl program
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] start perl server

2004-06-16 Thread kovzol
On 16 Jun 2004, Sven Neumann wrote:

 Hi,

 kovzol [EMAIL PROTECTED] writes:

  I had many hours of headache figuring the right solution out to write my
  own code in Gimp-Perl --- I was browsing the internet a lot, but there
  were many versions of the same statements in Gimp-Perl with different
  syntax. :-( So I'm also afraid that my script will be incompatible with
  2.0.x --- that's why I don't really want to upgrade yet. :-)

 Most likely your script will just work. Fear of incompatibility is not
 really a good reason to stick to an outdated and unmaintained version.

Dear Sven,

as a developer of other software, I can agree with you. In addition,
relying on your information, I installed gimp-2.0.2 and Gimp-2.0
(AKA Gimp-Perl :-). (I'm not a Perl expert, it was a craze to install new
and new Perl modules... ;-)

Now Gimp starts OK, and I can work with it.

If I want to test the files in Gimp-2.0/t, I get the following:

[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t ls
loadlib.t  load.t  run.t
[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t perl run.t
1..26
ok 1
ok 2 # skip
ok 3 # skip
ok 4 # skip
ok 5
ok 6
ok 7
ok 8
run.t: unable to read the Perl-Server at run.t line 109. (ERROR)
run.t: required callback 'net' not found (ERROR)
[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t perl loadlib.t
1..1
ok 1

Now as I start gimp-2.0.2 and start a Perl server using the graphical user
interface:

[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t gimp-2.0 
[1] 17697
[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t 1087410137: server
version 2 started
1087410137: accepting connections on
/tmp/gimp-perl-serv-uid-500/gimp-perl-serv

[EMAIL PROTECTED]:/usr/src/packages/SOURCES/Gimp-2.0/t perl run.t
1..26
ok 1
ok 2 # skip
ok 3 # skip
ok 4 # skip
ok 5
ok 6
ok 7
ok 8
run.t: unable to read the Perl-Server at run.t line 109. (ERROR)
run.t: required callback 'net' not found (ERROR)

Is this OK? (I got the same output when no Perl-server was started.)

Now I'm trying to start my gimp-1.2 Perl-Fu script (attached):

[EMAIL PROTECTED]:~ cd /home/wmi/cvs/wmi/ui/
[EMAIL PROTECTED]:/home/wmi/cvs/wmi/ui ./oval-buttons.pl
1087410392: accepted unix connection
Illegal default font description for perl_fu_mysite_buttons: -*-luxi
sans-medium-r-*-*-24-*-*-*-*-*-iso8859-2
oval-buttons.pl: Expected an INT32 but got 'BG_IMAGE_FILL'. Add '*1' if
you really intend to pass in a string at ./oval-buttons.pl line 110 (DIE)
1087410424: closing connection 9 (45 requests in 32 seconds)

The error message appeared after I changed the font (successfully) and
pressed OK (finally, to generate the .xcf file).

In gimp-1.2 there were no such problems (and the .xcf file was
successfully generated).

Could you please help?

TIA, Zoltan


oval-buttons.pl
Description: Perl program
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Re: perlgimp question (fwd)

2004-04-13 Thread kovzol
 Hi,

 kovzol [EMAIL PROTECTED] writes:

  Fortunately I have managed to solve this problem. An Xvfb server was
  needed. After I started it and added export DISPLAY=:1 into the PHP
  script which calls the gimp-perl script, everything works fine. :-)

 Perhaps you should consider to update to GIMP 2.0 then which doesn't
 need the virtual X server to run in batch mode any longer.

Dear Sven, thank you for the suggestion! As far as I can, I'll consider
the update. The code currently works OK, however it is quite slow: 4
seconds/file. I think I should also consider using a perl server instead
of running my script individually each time. Is GIMP 2.0 faster than 1.2
for image manipulations?

Zoltan

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


[Gimp-developer] perlgimp question (fwd)

2004-04-12 Thread kovzol
Dear Colleagues,

I have just subscribed to the list. I'm a beginner in programming
perl-gimp. I posted a help message to Dov Grobgeld a few minutes ago, but
for sure I send my question to the list as well. If somebody can, please
help me!

Yours sincerely,

Zoltan Kovacs
assistant teacher at Bolyai Institute
[EMAIL PROTECTED]
http://www.math.u-szeged.hu/~kovzol

-- Forwarded message --
Date: Mon, 12 Apr 2004 17:47:05 +0200 (CEST)
From: kovzol [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: perlgimp question

Dear Mr Grobgeld,

I read your article on the net about Perl-Gimp. Finally I found something
detailed information which describes Perl-Gimp! Thank you for this
wonderful howto!

I also wrote a script in Perl. In fact, I modified and used many sources
and this script is the result of learning Perl and Perl-Gimp from scratch
within about 8 hours... :-) It works fundamentally OK, however I still
have a problem:

If I don't have a graphical shell running on the working machine (e.g. I
have to use terminal login or CGI execution) I get the following message:

$ ./oval-buttons.pl -font_size_pixels 11 -text_string Hello
oval-buttons.pl: protocol error (1) at
/usr/lib/perl5/vendor_perl/5.8.1/i586-linux-thread-multi/Gimp/Net.pm line
66. (ERROR)
protocol error (1) at
/usr/lib/perl5/vendor_perl/5.8.1/i586-linux-thread-multi/Gimp/Net.pm line
66.

I attach my script to you. You can also use it for any purpose, if you
like it. I'm using SuSE 9.0 which works with gimp-perl-1.21.

If you can, please give me some advice, how to continue. Any help is
greatly appreciated. I read that you still work with Perl-Gimp and
probably know some tips and tricks as you mention a few words about Using
Perl::Gimp in a CGI environment.

Thank you in advance!

Best regards,

Kova'cs Zolta'n
assistant teacher at Bolyai Institute
[EMAIL PROTECTED]
http://www.math.u-szeged.hu/~kovzol


oval-buttons.pl
Description: Perl program
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


[Gimp-developer] Re: perlgimp question (fwd)

2004-04-12 Thread kovzol
 protocol error (1) at
 /usr/lib/perl5/vendor_perl/5.8.1/i586-linux-thread-multi/Gimp/Net.pm line
 66.

Fortunately I have managed to solve this problem. An Xvfb server was
needed. After I started it and added export DISPLAY=:1 into the PHP
script which calls the gimp-perl script, everything works fine. :-)

Thank you for your attention.

Regards, Zoltan

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