In last week's article ("PHP/ CSS Searchable Image Gallery") we looked at how we could build an image gallery using PHP and MySQL and then display it with minimal effort by positioning the images on the page with CSS. Today we build an admin tool that allows you to define thumbnail images which we will link to the main image, but rather than blindly resize the thumbnail to within a set of specific size constraints, we will interactively provide you with a way of selecting a portion of the image to use as the thumbnail.
So, using this code you can interactively choose which area of a photo to use as a thumbnail, looking far more professional than presenting a tiny hard-to-see thumbnail of the whole picture. As an example, here are two seperate areas being selected as thumbnails, using the script provided and explained in this week's tutorial.
Please note that this article forms part of a chapter in the DMXzone e-book PHP Web Applications for Dreamweaver: Juicy Solutions for the Busy Developer.
Allan comes from Cape Town, South Africa. He has been implicated in writing for several WROX, glasshaus, Wiley and Apress publications, generally in the 'cool stuff that PHP can do' sections.
You can catch up with him at his website http://www.mediafrenzy.co.za.