Since most of my blog entries have many images in them, I have been spending a lot of my time resizing, uploading and organizing my images. I decided that a photo gallery program would be a good addition to Cleghorn Creations. I installed Coppermine and am really happy with it. I am able to dump my pictures from my camera to my computer and then quickly upload them into Coppermine and instantly have thumbnails generated and also have them all organized for me.
The Cleghorn Creations Gallery is now available at:
http://gallery.cleghorncreations.com. I will be updating this everytime I add an image to the blog. I probably will not go back through and move the old images into it.
Once I had this up and running, I decided that I needed an easy way to import a Coppermine album into a blog entry. For most of my blog entries, I start with a series of photos and then go back and type in my information between the images. I wanted a way to quickly insert all of the images from an album so that I could start typing around them. I decided that the best way to do this would be to modify the entry form in Serendipity ( my blog software ) to have a place where I could choose a Coppermine album from a list and click a button to import all of those images into the blog entry.
For the first step, I modifed the file in serendipity /include/functions_entries_admin.inc.php. I changed this to have a drop down menu. I also wrote code in this file to run an SQL statement against the Coppermine table cpg_albums. This was made easier because I merged my Cleghorn Creations tables, Serendipity tables and Coppermine tables all into one database. I like this format because all of the code on my web system can access any data without having multiple database setups.
After choosing an album from the list I simply press the Insert Album button. This button is actually in a seperate IFrame. This allows the frame to call back to the server to get the list of pictures for the album selected without having to refresh the entire page. When the button is clicked, it redirects the IFrame to an address that does another select on the cpg_pictures table. It simply returns the list of pictures that have the specified album id.
This will be a big time saver for me and will hopefully allow me to have more blog entries while focusing more on my projects than on repetative work of moving images around. One of the side effects of my new workflow that you will notice is that the thumbnails on the entries will be much smaller and the large images will be much larger and more detailed. This is because I had previously been sizing my thumbnails at 320 x 240 and the large images at 800 x 600. Now the large images will be the original size that they come on my camera. I think I will keep it this way because there is a lot more detail in the larger images. I think the more detailed images will allow for a better record of my projects.
The code that I wrote to do this is available for free with a Cleghorn Creations account. You can get it
here.