JCPhoto Album

posted December 24th 2004 at 1542 EST in 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 800×600 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 400×300 and 40×30. 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 800×600, 400×300, and 40×30. 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 :

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

5 Responses

  1. #1 Michael Liu
    4 years, 8 months ago

    hi, could you send a copy of the codes to me? i want to learn how you program it
    thank you

  2. #2 jehiah
    4 years, 8 months ago

    sorry for the confusion, the download link above wasn’t working. It is corrected now.

    enjoy.

  3. #3 Vineet
    4 years, 5 months ago

    Hello,

    Just wanted to say that your website is one of the BEST examples of creative coding out there.

    All the very best in whatever you do!

    Regards,
    Vineet

  4. #4 Jehiah
    4 years, 5 months ago

    Thanks for the props. I guess it helps to enjoy programming =)

  5. #5 Glangy
    4 years, 1 month ago

    hi, is it possible to send me the script to resample and rename the images in imagemagick. It is my first website for the local
    youth-movement.
    thank you