Hello again,
I am working on a class project involving the use of the GD module and CGI and have run into a bit of a brick wall.
In order to understand how to modify remote images I stole the following code from this tutorial the put in some ‘my’ statements and put in my own URL.
now I am getting a 500 error with the following message in the error log:
gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x64 0x7 Can’t call method “colorResolve” on an undefined value at /my/perl/l/r/my.cgi line 7.
Premature end of script head /my/perl/l/r/my.cgi
#!/opt/bin/perl -w use strict; use CGI ':standard'; use GD; my $image = GD::Image->newFromJpegData("http://www.funnyandjokes.com/p +ictures/images/bush_lord-of-the-rings.jpg"); my $black = $image->colorResolve(0,0,0); $image->string(gdGiantFont,2,10,"Eat More Hobbits!",$black); open(FILE, ">text1.jpg") || die "Cannot open text1.jpg: $!\n"; print FILE $image->jpeg;
Could someone please clarify what is happening and tell me how to get this to work?
Thank you for your help
-moxIn reply to Error log clarification needed... by chinamox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |