cosmicperl has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,
  Trying to generate some web graphics with ActivePerl 5.8 build 808 on Win32 is driving me crazy. There is no ppm for GD and none for Image::Magick. So you are left with Imager, which I have no problem with as I usually prefer Imager. But what's killing me is that after several attempts to make a jpg, I turned on the error checking and my code was fine, just that the Imager ppm on Win32 doesn't support jpg. Nor PNG, nor GIF!!! I did a report of what it can support and got:-
bmp rgb w32 pnm tga ifs raw
??? Where are the beloved web formats??
I've tested and bmp output and it worked fine. But I need to output in jpg, gif and png. Does anyone know a work around for this?? The script is going to end up on lots of different Win32 installations across the net, so I REALLY need to try and do it with the modules that come with the distribution (I know Imager doesn't, but it'll be hard enough to get them to install that).

Please oh Masters of Perl Wisdom, can you provide a solution??

Lyle Hopkins

Replies are listed 'Best First'.
Re: Win32 jpeg writing woes :(
by syphilis (Archbishop) on Sep 15, 2007 at 07:01 UTC
    Hi cosmicperl,

    For GD:
    ppm install http://theoryx5.uwinnipeg.ca/ppms/GD.ppd

    For Image-Magick:
    ppm install http://www.bribes.org/perl/ppm/Image-Magick.ppd

    Cheers,
    Rob
      Hi,
        Thats very useful for my testing purposes, but that isn't going to help my situation for what I am trying to achieve. Like I said this is going to end up on different Win32 servers across the net running on shared hosting packages. It's hard enough to get them to install perl modules from the main ActiveState repository, they certainly wont install them from unofficial repositories like this. So at best I'm working with Imager and the core modules.

      Isn't there any PurePerl code somewhere (not including and XS) that can convert BMP to JPEG, PNG or GIF? All or one would do.

      Lyle
        Isn't there any PurePerl code somewhere (not including and XS) that can convert BMP to JPEG, PNG or GIF? All or one would do.
        That seems extremely unlikely. Those conversions would be extremely slow in pure perl, and there are perfectly good (fast) C libraries to do it.

        You might try to create a PAR archive of your dependencies which you can then ship with your script.

        -David