I've been taking digital pictures for roughly five years now. Over that time I've taken a few thousand. They're poorly organized but at least they're on-line.
Every once in a while, someone asks me what software I used to create my on-line photo gallery, and I laugh to myself. Why? Because it's two little Perl scripts that have evolved a bit over the last few years. But they're still really, really basic and just barely do what I need.
I'm posting them here in the hopes that someone else finds them useful. As unlikely as that is, at least I can point others to this page when then ask me what I use. :-)
WARNING: This is hackerware. If you're not comfortable figuring out how the code works and adjusting to meet your needs, please move along. These are not the droids you're looking for. There are bugs, stupid limitations and assumptions built-in. And it's not my best coding work.
But if Dan can make it work, it can't be that bad, right?
pic-conv2.pl is run while you're in a directory full of JPEG files (*.jpg). For each image, it calls the convert program from ImageMagick to produce small and medium sized images. So you'll end up with a foo-sm.jpg and foo-md.jpg.
pmi2.pl is the real workhorse. Run it after you've run pic-conv2.pl and after you've put a title.txt and description.txt file in the directory. It builds out the pages with header, footer, and navigation.
Use these at your own risk. Or not at all.
One of these days I'm gonna completely revamp how all this stuff works. Or I'll just use someone else's code. Who knows.
Posted by jzawodn at December 30, 2002 08:40 PM
Changes that I made include commenting out the -md step, since I take smaller pics than Jeremy does. I also made smaller thumbnails, and put them on a 25 cell table instead of the 4 Jeremy uses. My focus was to archive them, not really show them off. But the family that looks at them seem to dig it well enough.
The hardest part of the process is getting ImageMagic installed, IMO. I run everything on Jeremy's server, so it's installed already. but when I set it up for a friend, that part took a few hours. Of course, I'm an NT Admin. So YMMV.
The most needed imporvement, which I've always wanted to do but never got around to, was to incorporate some code to read EXIF meta-data and store with the pics. I also need to automate image rotation. I go through by hand now. :(
And Z, you may want to change the "my camera is a DC-210" part. You havn't had that camera for a few years now.
Damn, keep forgetting stuff. You'll also want to become good friends with this command, depending on which OS/camera you have.
rename -v 's/\.JPG/.jpg/' *.JPG
Pic-conv2 will process them, but PMI will link to lowercase jpg's. Best to rename them before converting.
I have made some changes to the scripts as well. I made a web interface to build the title, description, and image captions with the image viewable. Also, I automated the rotation. It seems my Kodak 280 names the picture different for horizontal vs. vertical shots. I took advantage of this. (This might not work for all cameras.) I have some more changes planned. The larger md pictures require a back to go back to the thumbnail list. I was going to make links back.
I have about 1200 pictures processed with the scripts.
PHP Photo Gallery is a pretty cool way to put pictures online. It is very customizable and well maintained.
i've had that camera for a few years now.
Hey Asa, I missed you when I was in town. I called up to your office, but you weren't there. Left you an incoherent message. Where is your cube now? You weren't on the 9th floor.
What is the filename difference? I have a DC3400, and they all look like DCP_xxxx.JPG on my Win2K box. I recall XP naming them differently.