| <david.weekly.org> | May 18 | 2008 | |
| code | Pixdir: The Picture-Directory Scriptset | ||
|
"Pixdir" is the name I gave the set of crude scripts I wrote up to
create the pictures section of
my website. These scripts are not very elegant; at
some point, I'll probably get sick of them and write something much
better.
In order to use this suite, you'll need to download and install
Image Magick. (Really,
all I need from this wonderful toolkit is the program The main script, pixdir, is written in Perl and outputs PHP code embedded in HTML, with JavaScript snippets (just to do the popup windows). So I guess it's kind of a quad-lingual setup. It's a hack. The script runs through the current directory and any subdirectories thereof, scouring for .JPG files. If it finds one, it will check to make sure there is a file with the same name and a more recent date in the .thumb, .thumb-small, and .full subdirectories. These three directories contain small, really small, and "fullscreen" (bounded within 300x300, 133x100, and 700x700 pixels respectively). If it does not find these subdirectories, it automatically creates them. It then spits out an "index.php" file with the appropriate HTML for a table with a small thumbnail in each cell. There's lots of site-specific stuff in here, so if you want to make this script work for your site, you'll probably want to change it around quite a bit. (For instance, I currently have it so that when you click on a thumbnail, a bit of Javascript pops up a window that references a PHP script that displays the picture, a dark background, and a link to close the window as well as to the full-size (original) version of the photo.)
There are supplementary scripts r90 and
r-90, which losslessly rotate a specified picture
by 90 or -90 (270) degrees respectively. I found this handy. You will need
There's also
a pm script, short for "picture mover", that copies not only
a specified set of pictures, but also their corresponding thumnails to a
destination directory. Very simple. It works like That's all. I hope this is helpful to someone. It's not teribly elegant. | ||
| content & layout © copyright 1995-2008 -{ david e weekly }- | ||