JCPhoto Album

by @jehiah on 2004-12-24 15:42
Filed under: All, Articles, Javascript

I think i'm finally happy. It is all automated as it should be for an ubercool web geek.

Sony P150

This is the camera I finall ended up with to replace my stinkin V170 which verizon crippled, and motorola equiped with a sub-par camera. At the $400+ I paid for it did nothing but frustrate me as a camera. The Sony P150 was first choice because It's Small enough to carry around in my pocket, has a larger CCD than most cameras (1/1.8"), Does well in low light (especially on a tripod when you can use the double exposure which cancels out the image noise), has optical zoom. Suprisingly the huge resolution (speaking in pixels not ccd size) didn't matter to much and was one of the least important factors in my decision to buy this camera.

iPhoto

iPhoto was the logical choice on the Mac to import photos from my camera. It's nice and easy, plug in the camera and click 'import'. iPhoto has a simple interface to rotate photos as needed which is really the extent of what I want to do as far as editing my photos.

Imagemagick

Now the fun begins. I have a shell script which I run with the click of a button after my import into iPhoto. This script takes the huge 5 or 7 megapixel images from the iPhoto directory and both resamples them to 800x600 through Imagemagick, and renames them with the date and time instead of a serialized number.

Rsync

The last thing the script does is copy any new image files to the website, and execute two imagemagick calls on the server to create two thumbnails at 400x300 and 40x30. These two calls to imagemagick could easily be done first, then part of the rsync call.

JCPhoto Album

I have a PHP photo album which is really a JavaScript photo album which I am naming JCPhoto Albumn. The photo album is modled after the one that won Flash Interface Design Awards at Microgarbage It was done in flash, but I have re-done it in javascript to allow for some more flexibility in implementing it on my site. This is faster on the user side because all the images are loaded in a smiple javascript array at the first page load so there is less back and forth between the server.

All the album requires is that the files be in the format MM-DD-YY_HHMMSS.jpg (where second is optional). The files get sorted into three folders of sizes 800x600, 400x300, and 40x30. The only thing php does is spit out a list of the image names a a javascript array. (This could easily be replaced with a shell script that generates a javascript file with the image names every time the images are updated).

The features I added (over the flash version) are :

  • Ability to change the page background
  • Handles days with more than 20 images
  • Shows tooltip of when the image was taken
  • Less hits to the server for filenames
  • Handles images which are in landscape and portrait mode (ie: the camera was turned)

Preview

You can preview the results of my hard work here.

Download

If you want to download the photo album get it here JCPhoto_Album-1.0.tar.gz

Subscribe via RSS ı Email
© 2017 - Jehiah Czebotar