Currently playing on my computer (tune in: pls, asx)
The Daily Biff
     
 
Wed, 19 Dec 2007

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:

    jhead -ce image.jpg

or for multiple images:

    jhead -ce *.jpg

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



         

December 2007
Sun Mon Tue Wed Thu Fri Sat
           
19
         

About
The Daily Biff
Rus Berrett's weblog

Contact Me
Email: rus at berrett dot org
AIM: biffordtdavis

Search 'The Daily Biff'



Proclamations
Exaggerated opinions of my own importance. Proceed with caution.

Buy Me Stuff
My wish list is my gift to you (yes, shameless, I know).

Subscribe
Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.

Categories
You can isolate posts by category using the following links.

  •   ·x10 (1)
  •     ·2005 (23)
  •     ·2006 (18)
  •     ·2007 (17)
  •     ·2008 (27)
  •     ·kids (1)
  •     ·meat (14)
  •     ·cola (2)
  •     ·milk (2)
  •     ·meat (1)
  •     ·utah (5)

Archives
Past entries are available for review.

Blogroll
These are a few blogs run by my esteemed friends and colleagues. My personal comments about the blog (and its author) can be accessed by clicking on the "wtf?" graphic to the immediate right of each entry (wtf = "What the flip?" as in "What the flip is grandma doing at the sand dunes?").

Family

What the flip is "Yatyk's Musings"?  And who the flip is Mark Berrett?

Friends

What the flip is "The Improvist"?  And who the flip is Dan Brian?
What the flip is "The Borel-Cantelli Lemma"?  And who the flip is Norm Jones?


    
 
    Valid CSS!

Valid HTML 4.01 Transitional

Powered by blosxom