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

I've read with some interest the replies to other such questions. I've also had a look throught the "snippets" section but I've yet to find what I'm looking for.

I'm currently writing a Picture Gallery script and would like to be able to limit the size of the "full" image but need to find the image size from both .jpg & .gif files. Can this be done with just plain Perl (and standard Modules)?

Secondly, the Thumbnail pages are currently (and I liked this term so I'll use it myself) "Dumbnail", ie. I have used width and height sizes (50x50), however, this can cause the page to take ages to load on a 56k modem! It would be nice to be able to use ImageMagick or GD, but these aren't available on my server and are unlikely to be available on 95% of my target users servers. Is there any way within Perl to resize and rewrite image files (.jpg & .gif files only)?

Thanks!

Replies are listed 'Best First'.
Re: Another Image Resize Question
by grep (Monsignor) on Oct 18, 2002 at 23:32 UTC
    If you take a look at the column where merlyn (well merlyn's unnamed friend) coins the term 'dumbnail'. He mentions the freely available NETPBM Utilites, other than that I have heard of no standard module to handle image resizing.

    I understand installing ImageMagick can be a pain but installing GD is pretty easy (and available as a ppm if you use certain evil OS's). You might want to think about installing a module in your home diectory.

    Update: Changed broken link to working link



    grep
    Mynd you, mønk bites Kan be pretti nasti...
      Thanks grep

      Sadly the "NETPBM Utilities" link is unavailable, but I'll have a look elsewhere for this!

      I've downloaded both ImageMagick & GD to have a look, but they are beyond my (current) knowledge to decipher!

      Still...I'll keep looking for the solution.

Re: Another Image Resize Question
by Anonymous Monk on Oct 19, 2002 at 03:35 UTC
    *snicker* Sure it can, if you'd like to rewrite GD or Image::Magick in perl. What is stopping you?
      "*snicker* Sure it can, if you'd like to rewrite GD or Image::Magick in perl. What is stopping you?"

      Now that would be an interesting project, but out of the timescale I have for the script that I'm currently producing! Maybe an update? ;-)