I am trying to use the CPAN "Imager" module to do some fairly simple imager processing (mostly edge detection) using grey-scale JPEG and GIF files as inputs.

The source images are color, but since I only need to detect edges, I have converted the color images to 8-bit grey scale (JPEG and GIF depending upon what the source file format was) and saved then as grey scale for input to my Perl script.

I have been developing the script on my PC at work (an Intel Dual Core with about 2MB of RAM running Windows XP Pro). I used the constructs:

#!/usr/bin/perl use strict; use warnings; $| = 1; # set print buffering to not buffer use Imager; my @read_types = Imager->read_types; my @write_types = Imager->write_types; print "Read Types:\n"; print " ",join(", ",@read_types),"\n"; print "Write Types:\n"; print " ",join(", ",@write_types),"\n"; exit(0);

It showed that, as I needed, it supports JPEG and GIF formats among others.

I decided to bring my work home with me to continue the development over the weekend.

The script kept failing and it took me a while to figure out why.

Then I tried the above listed script and found that the output says Imager on my home laptop only supports the following:

Read Types: sgi, bmp, ico, pnm, tga, raw Write Types: sgi, bmp, ico, pnm, tga, raw

I am confused. This says that on my laptop (an Intel(R) Pentium(R) M 900 MHz with 500 MB of 593 MHz RAM runing Windows XP Pro) I don't have support for JPEG or GIF! These are two of the most popular image formats.

In both cases (i.e., on both computers) Imager was installed from the ActiveState web site using the Perl Package Manager (PPM) and both are the same version of Imager (version 0.78).

I have looked at the CPAN documentation for Imager and its sub-topic documentation (e.g., the "Files" and "ImageTypes") but all it says is that the file types supported are determined by what options Imager was compiled with; but since on both computers the modules are pre-complied and loaded from ActiveState using PPM then I wouldn't think that is the source of the discrepancy.

I keep thinking this should be obvious, but it isn't to me. So, I have a three questions.

First, this doesn't make sense to me, so what am I missing? (it's got to be me).

Then, on the outside chance that it *isn't* so straightforward:

Second, why do two different Intel processor platforms (both running Windows XP Pro) support different Image file formats?

Third, why would *any* platform, irrespective of the processor, *not* support JPEG and/or GIF?

As an aside, I have converted the images to BMP format (which both platforms support) and am getting along. But the above is still troubling me.

ack Albuquerque, NM

In reply to CPAN "Imager" Module Question by ack

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.