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

Does anyone know of a pure perl solution to convert a .gif image to .jpg format?
-AM

Replies are listed 'Best First'.
Re: pure perl gif => jpg
by Mr. Muskrat (Canon) on Nov 07, 2002 at 16:48 UTC

    Not that I know of... perhaps you could look up the specs on the two file formats and write one up. graphic file formats should help a bit.

    Any reason why it has to be pure Perl? There are some nice graphics modules available.

Re: pure perl gif => jpg
by broquaint (Abbot) on Nov 07, 2002 at 17:18 UTC
    The GD module is pure perl, although it does contain some code which needs to be compiled, and if you get a pre-compiled version then you don't even have to bother with that. Although the current GD doesn't support the GIF format any more due to patent issues, older versions will work fine if you have the correct libraries.

    If you find GD a little tricky, then there's a spangly new alternative which doesn't require an external image library (although probably requires format specific libraries), which is Imager.

    Although both these require some XS code at some point there's a very good reason for that - doing image manipulation with perl would most probably be prohibitively slow, but to be sure I guess there's one way of truly finding out: write the modules yourself.
    HTH

    _________
    broquaint

      If you say "it does contain some code which needs to be compiled", then it isn't pure perl. GD doesn't require an external library; it can include the libgd inside the XS extension. But it does require the XS interface code and the libgd library to do the image manipulation.