liverpole has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Perl as a front-end and a back-end to HTML -- is it possible?
by zentara (Cardinal) on Mar 19, 2006 at 17:25 UTC | |
|
Re: Using Perl as a front-end and a back-end to HTML -- is it possible?
by NetWallah (Canon) on Mar 19, 2006 at 18:26 UTC | |
by liverpole (Monsignor) on Mar 19, 2006 at 18:49 UTC | |
by NetWallah (Canon) on Mar 20, 2006 at 05:21 UTC | |
|
Re: Using Perl as a front-end and a back-end to HTML -- is it possible?
by jdporter (Paladin) on Mar 19, 2006 at 17:06 UTC | |
|
Re: Using Perl as a front-end and a back-end to HTML -- is it possible?
by rinceWind (Monsignor) on Mar 19, 2006 at 18:11 UTC |