Practice
Over several years of working on many sites and services, I used the same script, gradually expanding its functionality. Over time, this script became practically ideal. It has minimal coupling and dependency on other modules, which ensured quick integration with any framework or CMS, and it overlays a logo onto images proportionally in the right place. This script can resize the source image to given dimensions (5 types, crop or don't crop, preserve proportions or not, dominant width or height). It can also take images from above the site root, meaning the originals are inaccessible from outside, and it supports caching. It can log or send an email notification about "requested" missing images. It can check the referrer, and if there is an embed from another site, it shows a message instead of the image; and if the image is opened full-screen (without the site), it performs a redirect to the original article... All in all, a really great module turned out!

Comments