Greetings fellow monks,

On my current project, we need to be able to accept a number of image formats from our users. The easiest way to achieve this is by using Image::Magick, which handles a very large number of input formats, and using it to convert the input file into a standard image format, such as LosslessJPEG.

The Image::Magick module is a very straightforward wrapper around the ImageMagick library, because of which it has lots of C-isms (not having thrown exceptions, methods returning complicated numbered error messages, and so on) as well as ImageMagick's own limitations (returning descriptive names instead of standard MIME types, for instance).

I've got two questions:

  1. Is ImageMagick still the best library for image conversion on Windows in Perl? Are there better libraries out there which I haven't heard about?
  2. Since I am going to be collating all my Image::Magick fixes into one module anyway, does it make sense to package this into an Image::Magick::Image module, which will encapsulate a single ImageMagick image? This module can then provide exceptions on input/output methods, make it easier to access image attributes, and generally fix up ImageMagick's more irritating warts. Do you think there is a need for such a module? Would it be worth the effort of packaging it for CPAN?

Thanks for your help!

Update: Removed reference to Image::Magick being procedural; this was just plain wrong. Thanks, mirod!

Update Oct 24, 2008: Matt Trout recommended that I use Image::Magick::Object (or my own variant on his suggestion, Image::Magick::Wrapper) as an overall package name. Individual images can then be wrapped by Image::Magick::Wrapper::Image, and we could wrap other IM objects as well - a path could be Image::Magick::Wrapper::Path, for instance. Much easier to extend functionality that way. My only worry is that names will get overly complicated. Any comments/suggestions?

Update Oct 24, 2008: It's going to take a couple of weeks at least to get my very small codebase released to CPAN. I've only got about three operations wrapped so far: Read(), Write(), and converting some of Image::Magick's inbuilt format names to standard MIME types. If anybody else feels like going ahead with this, please do! Otherwise, I'll make good my promise and make sure I get a very early release sometime in November. Once it's out under a good license, interested parties can get cracking on wrapping all of Image::Magick.


In reply to Image::Magick: Still the best? Can it be improved? by ggvaidya

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.