I am having fair success using Image::Magick and PerlMagick for a web application that I am building. I am using the module and Image::Magick to save uploaded images to three different sizes ( a thumbnail, a medium and large sized jpegs) and Annotating the mid-sized and large sized. Problem is, I cannot seem to get Annotate to work very well...

#!/usr/local/bin/perl use Image::Magick; my $image = Image::Magick->new; my $x = $image->Read("robert.jpg"); warn "$x" if "$x"; $x = $image->Annotate(text=>'Hello...Are you there?'); warn "$x" if "$x"; $x = $image->Write("robertanno.jpg"); warn "$x" if "$x";

This is the simplest example I could make to demonstrate the problem that I'm having.

This loads robert.jpg and saves robertanno.jpg fine, but the Annotate returns the following error PERL:

sh: gs: command not found sh: gs: command not found

Any ideas about what is happenning? I've experimented with setting some of the other parameters for Annotate (font=>'font', gravity=>'whatever', fill=>'color' ) but I keep getting the same error. Is it that Image::Magick doesn't have something available to it that it expects? (font libraries....something?)

Any help would be great! Thanks!

An aside: By placing a

print "Error is happening either before or after me";

either before or after the Annotate command, the output is still the error and THEN what perl prints. Sort of weird. I'm curious why this is happenning. Its like the error is coming from Image::Magick maybe, and then Perl gets its chance to print its separte errors afterwards....I dunno though...any ideas on this?

Jeff Pflueger - Struggling Perl knowledge sponge


In reply to Annotate and Image::Magick by jeffpflueger

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.