A geeky sort of weekend.
It was time to stop procrastinating and do some more coding on updates for David Pentland’s website. David wants to be able to give more details about the pictures on the site, for example, materials, size information and not least, price.
I’d completed the database design a couple of weeks back. Whilst I had stated coding the new pages, I was having trouble with the AJAX code. So, this morning, I simplified the code and now everything that I had planned to write works properly.
Once I had finished coding on David’s site, I turned my attention to another problem that I had experienced a few months ago, namely how to resize images to make a thumbnail gallery.
The O’Reilly book ‘PHP in a Nutshell’ showed the way, but I was having real problems getting my head around the header() function and how it works. I took a look at the HTML specification, but I could feel my will to live ebbing away as I read.
A quick Google search brought up a plethora of php examples. I took the simplest code and within a couple of hours had modified it to enable me to produce a resized jpeg image which had the same aspect ratio of the original file. I also added code to enable the size of the final image to be varied.
To test the code fully, I knocked up a PHP script that produced a thumbnail gallery from any jpeg images that may be in a directory. In total, it took a couple of hours to produce a working gallery. All that’s left to do is to do some styling and then work out how to roll it out on Monomagic.
A damned good day’s coding, which was just as well as the weather has been atrocious today. Time for a glass or two of wine!