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

-mox

In reply to Error log clarification needed... by chinamox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.