I'll need to investigate the source and maybe redo gdlib and then GD.pm again.


is this the same gd_example.cgi that comes with GD.pm, in the demos dir of the package, or are you running the script we've pasted here for you?

The one I had, modified with the suggestions from the list to rule out differnt things:


#!/usr/bin/perl

use strict;
use warnings;
use GD;

my $image = GD::Image->new(100,50);
my $white = $image->colorAllocate(255,255,255);
$image->transparent($white);

my $fontcolor = $image->colorAllocate(0,0,0);
my $font = GD::Font->Small();

$image->string($font,2,10,'hello world',$fontcolor);
my $png = $image->png or die $!;
binmode STDOUT;
print $png;


Because I tried running gd_example.cgi as given, and got a similar error "no such file or directory" which makes no sense since we aren't opening any files or working with any files.


[Sun Jan 09 13:53:12 2005] [error] [client 127.0.0.1] (2)No such file or directory: exec of '/home/webadmin/madhouse/html/cgi-bin/gd_example.cgi' failed, referer: http://localhost/madhouse/bleh.htm
[Sun Jan 09 13:53:12 2005] [error] [client 127.0.0.1] Premature end of script headers: gd_example.cgi, referer: http://localhost/madhouse/bleh.htm

To rule out webserver/cgi/browser issues, I'm not running it in a browser.

I just want it via CLI to have some binary image guts instead of nothing or an error.

however it also occurs to me that gd_example.cgi points to
    #!/usr/local/bin/perl
and not
    #!/usr/bin/perl

it wouldn't even compile if you had a non existant perl in the shebang and the error may be different if it did exist but was different than the other perl. This also is not the problem.


which is where it's installed on my system, and fixing THAT to point to a perl that DOES exist, the script runs perfectly.

nothing whatsoever to do with temp files, or any such nonsense. the error makes complete and utter sense if you just think really hard about

you don't even have to think that hard :)

No such file or directory at ./gdtest.pl line 15

means $! at line 15 (my $png = $image->png or die $!;) is saying "No such file or directory"...

what makes sense and what doesn't about the error message.

the script doesn't open any files, so how could it give a 'no such file' error ? it's not printing a 'file' either, no, so toss that idea too.

and if GD were using tempfiles they'd be completely encapsulated by the GD object, and handled internally. If you got a 'no such file' error from GD itself, the script's die message would reflect that case and it would again be _obvious_ that it were GD's fault and not (pointedly) your own, or my own, or the gd-using-script-authors own, in pointing to a perl binary that 'does not exist' on this system.

So a non existant perl is giving an error about perl not existing?

What happens when you put a non existant path in your shebang line?

$ ./badshebang.pl
-bash: ./badshebang.pl: /usr/bin/fake/perl: bad interpreter: No such file or directory
$


$ ./gdtest.pl
No such file or directory at ./gdtest.pl line 15.
$

hmm, diferrent error from the shell and not perl, so how does perl die at line 15 is it doesn't exist again?

use your head, man!

Are you even serious? Why must you be rude and clueless? How could a shebang that does not exist, die() with a non existant file error on line 15?


ktrace and kdump shows that its an internal gdlib error, that gdlib can't open a dynamic object it uses. So GD *is* why the file is being opened and GD *is* "encapsulating" the error into $!, all from whatever png() is doing...

Thanks everyone for the assist, looks like I need to get the gdlib fixed up, prolly just linking the existing .so to the one its looking for I imagine.

have a good one ;p And no hard feeling Scott, just be nicer and try not to insult people's intelligence, especially if your reasoning is flawed ;p if your reasoning is correct insult away :)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to