I looked around on CPAN for modules that could generate thumbnail images on-the-fly with Apache 2.x, but all I could find except generic thumbnailers was Apache::GD::Thumbnail. Unfortunately, even after MINUTES of testing I was unable to make it work under Apache2. I concluded that this was probably because Apache2 is quite different from Apache 1.x, and proceeed to roll my own module.

Now, it works. It installs into httpd.conf like so:

<LocationMatch '\.jpg\$\d+'> SetHandler perl-script PerlHandler Apache2::Thumbnail </LocationMatch>
The idea is this: http://foo.bar/original.jpg$100 yields a thumbnail image that fits inside a 100x100 box. It works perfectly, using Image::Magick and a cache directory for performance.

I would have preferred to use the "?" character over "$" ofcourse, but I found no obvious way to match this in httpd.conf; I could pass ALL jpg images through my handler ofcourse, but that would hurt performance on a busy system. Suggestions would be MOST welcome.

My real issue though is this: The working name for my module is, as you can see, "Apache2::Thumbnail"...

I have never uploaded to CPAN. I don't know if this is a good name, and I certainly don't know if the module is "good enough" to take up this spot in the namespace.

Is there a place within the monastery where I can perhaps post the module to have it audited/reviewed/flamed/ridiculed? I don't want to make a total a^H...BEHIND of myself by uploading a module people warn each other about in years to come.

For now, the script can be found here: http://floyd.atc.no/Programming/Perl/Apache2::Thumbnail/ and the module can be seen in action here: http://floyd.atc.no/Fun%20stuff/Images/


In reply to Before uploading my module... by FloydATC

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.