✓ I'm available for hire! Check out my open source work on Github or drop me an email

Douglas F Shearer

Posts Tagged with images

There are 2 matching posts.

Improved Image Resizing and Site Move

After much playing around I decided that my image resize script was chewing up too much processor time and memory, thus making page loads a lot longer.

The solution? Cache the thumbnails, and each time the script is called, check to see if an image with those parameters has already been created. If it has, return that image straight from storage, no waiting for it to be re-rendered.

But what happens if the original image is changed, surely the cached thumbnail will be out of date? For this I check that the last-modified date of the thumbnail is greater than that of the original. If not, it renders a new one.

Pretty spiffing. I’ll probably release this script when I’ve cleaned it up a bit

Anyone sharp eyed will have noticed that the URI for this page has changed slightly, I moved my site to the root directory, just felt like it really. I’m getting a lot of things not working because of this, so email any errors you come across to dougal@shearfx.com. Thanks.

 
 

Testing Image Resizing

This evening I made a script to allow the resizing of images on-the-fly. Is pretty nifty. The Image below is created from a 1024*768 .PNG file, resized to a 200 pixel wide .JPG with quality of 50. The original file can be seen by clicking the thumnail.