Greetings fellow monks,

Last week we returned from a short vacation in Vieques, Puerto Rico, and of course had plenty of digital pictures to sort through.  I had toyed before with writing a short Perl program to categorize digital photos; something that would let me rotate and/or resize photos needing editing, choose which photos to delete or save for the final presentation, and ultimately create an HTML page for viewing them.

Now, let me say up front, that I'm aware there must be dozens of such programs available, and probably quite a few good freeware versions as well.  But in my case, it's not just the fun of writing my own, there's also the learning experience which I enjoy, and the flexibility of having it do *exactly* what I want it to.

So, in designing such a program, an obvious approach which came to mind is to use Image::Magick to create the initial thumbnails, and write an HTML page to render the thumbnail images for quick viewing by a favorite browser (ie. Firefox).  Browsers are, of course, optimized for speed in displaying images, so it seems only natural to make use of HTML for the initial presentation for selecting editing operations.

However, this is where I run into problems ... I can't figure out how to communicate from the HTML page back to the Perl program (or even a separate Perl program), in order to process those images which the user selects.  I searched for and found information on writing files from Javascript, but of course Javascript was not designed for doing this natively (in the client/server model under which a webpage usual operates, it would be a huge security hole to allow Javascript to do any kind of file-processing), so the only way I can of making such an approach work would involve Active-X, and thus Internet Explorer, which I am unwilling to restrict myself to.  Another solution might be to run Apache and make use of CGI scripting, but that seems like a lot of extra work just to make Perl interface with the HTML page.

I even tried a quick test to see how feasible it would be to use Tk, and, as suspected, even trying to load just a small number of photos takes an inordinate amount of time.

So, can someone kindly tell me, what is the standard way to do something like this from Perl?


@ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"

In reply to Using Perl as a front-end and a back-end to HTML -- is it possible? by liverpole

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.