28/12/2014 - Photo Albums

Problem With Images

I have put quite a bit of effort into the Photos section of the site.

As well as what you see 'on the surface', there is a management system to help make publishing new material quicker and easier.

The website exists in two modes - there is the 'live' site, that you see, and I use behind the scenes to manage the content, and there is the 'test' site, that I use to perform development and maintenance, without damaging the 'live' site.

I wanted to keep the code in 'live' and 'test' separate. Easy enough the more technical amongst you are probably thinking ... just either have exact duplicate systems, or keep the code in distinct directories. The former option would take up more disk space than I needed, so I opted for the latter option. I do keep a backup of the 'live' system on my home computer, in the unlikely event that my ISP has a problem , and loses it all, with no backup, or I decide to switch hosting companies, which I came close to last year, when they outsourced their CGI support to a third party, and my website was offline for several months while I got it fixed. Oddly, my ISP offers no support to the likes of users such as me, who have written code and use a backend database, but I guess that is another blog.

But what about the graphics components I want to use - photos, animated GIFs, etc. It would be very wasteful to duplicate everything.

The management code can now detect automatically whether it is in test or live mode, and will only reference images in 'live', whatever its actual state.

Another issue the code now copes with is bulk population of albums, by letting me navigate the file system check-boxing the images I want in a particular album, and setting the comment for each selected image to a default setting of 'to be added'. This introduced a problem for me - finding and updating such album entries with 'real' comments. OK for one or two images, but often I want to add 20 or more images to an album at a time, and adding comments afterwards is a pain.

Problem Solved

To overcome this I added a filter feature that will only display those images with 'to be added' as the comment. As I add my own real comments, the list gets reassuringly shorter. Job done !

Future Developments

Future development of this feature of the site will be to reference images that do not actually live on the webserver, to save even more disk space, which is running out rapidly.

I get 500.00MB free from my ISP, and am currently using 258.38MB, which includes anything I put in the file system. I'm not sure what happens when I use it all up, but minimising stuff I want to reference, but do not have to store and account for, seems like a good general principle to follow.

This site © 2018 Mark Plant