in reply to Re: Understanding GD.pm
in thread Understanding GD.pm

Thanks for your help, I have commented out any reference to
print "Content-type: text/html\n\n"; replacing the initial print header with print "Content-type: image/jpeg\n\n";
using the line print $newimage->jpeg;
Now I get an empty image with the "X"

Replies are listed 'Best First'.
Re: Re: Re: Understanding GD.pm
by strider corinth (Friar) on Oct 31, 2002 at 17:22 UTC
    You said before that the script seemed to be stopping after you tried to make the new image from the old jpeg, which lines up with what you're seeing now. I'd suggest switching back to HTML output and changing the line to this:
    my $srcimage = GD::Image->newFromJpeg("churchmiddle.jpg") || print "GD +::Image->newFromJpeg('churchmiddle.jpg') failed: $!<br>\n";
    That should tell you a little more about what's going on.
    --

    Love justice; desire mercy.
      You know this is really getting me. The script still seems to stop printing right at that same line.
      my $srcimage = GD::Image->newFromJpeg("churchmiddle.jpg") || print "GD +::Image->newFromJpeg('churchmiddle.jpg') failed: $!<br>\n";
        I suspect that you're running into issues in GD.pm and dieing in the module. Before the above line put the following line to make sure the script sees your image file.
        unless(-e "churchmiddle.jpg"){ print "can't see the image"; }
        Unless churchmiddle.jpg is sitting in the directory with the script GD will die complaining about undefined values.