Building Polaroid Thumbnails with ImageMagick
My brother Brent recently
(re-)started publishing to his blog.
He made a comment to me a few days ago about how much time it
was taking him to create a blosxom entry that includes images;
building the thumbnails, creating the html for the entry, etc.
He uses blosxom - the same blog engine that I use.
I told him about a perl script I wrote and have been using
("thumbs")
that will take a set of images and create small 100 pixel high
thumbnails and build a blosxom-ready text file with the html all
nicely built automagically.
Well, that was all well and good, but Brent had something better in
mind. He thought that it would be cool to have "polaroid-like"
looking thumbnails... like the ones shown in
ImageMagick documentation (see
here).
So over the past few evenings I set to the task of reading the
ImageMagick documentation and then converting my plain
'old thumbnail generating script,
"thumbs",
into one that would build cool polaroid-like thumbnails... complete
with a caption, the slight rotation, and the drop shadow. I'm happy to
report it is done... and I have rebuilt all of the previously published
entries in December (that included family pictures) to use the new
polaroid-like thumbnails. See
here,
here,
here,
here, and
here.
(Pretty cool eh?)
The script does little more than issue a handful of ImageMagick commands
in series. But hat tip to my brother Brent for bringing this capability
of ImageMagick to my attention. The script is yours to download if you
like, it is simply called:
"polaroids".
There should be enough documentation in the script itself,
but feel free to e-mail me if you have any questions.
Oh... the caption for each polaroid... what text is used for the caption
itself? The caption text is globbed from the "Comment" field embedded
within the jpeg image.
There are probably several programs on Microsoft Windows or Mac OSX
that you can use to set the Comment field. I don't know what those
programs might be because I use Linux on my desktop and FreeBSD on my
web server... so I use a command line tool called
"jhead".
To install jhead on the Ubuntu desktop, type this:
sudo apt-get install jhead
To install jhead on a FreeBSD server, then do this:
cd /usr/ports/graphics/jhead
sudo make install
To use jhead to set a Comment for a jpeg image, then type
something like this:
or for multiple images:
jhead will even preserve the file modification date when
writing the comment to an image. This is a nice bonus since I use a
script,
"touchjpgs",
to set the image file modification date to match that of when the photo
was taken. The file modification date is used by my
"polaroids"
script to build a file name for the blosxom text file.
Happy photo blogging!
:: Posted by rus on Wed, 19 Dec 2007 11:45 pm
:: Filed under /tech
|