CImage and img.php
img.php enables server-side image processing utilizing caching and optimization of the images.
CImage is a collection of PHP classes enabling resizing, scaling and cropping of images. You can process the image and apply effects through filters and post processing utilities.
img.php is the front-end that takes URL-parameters from the querystring, load a default configuration and then uses CImage to carry out the actual image processing.
This is how it could work.
or with pretty urls.
#Get going quick and dirty
This is a quick and dirty way to get going.
We want a structure like this.
../cache . ├── img │ └── kodim23.png └── imgd.php
img.php in an all-included-bundle together with a test image and create the cache directory.
wget https://raw.githubusercontent.com/mosbth/cimage/master/webroot/imgd.php wget https://raw.githubusercontent.com/mosbth/cimage/master/webroot/img/kodim23.png mkdir ../cache && chmod 777 ../cache
You can now open up your browser and reach the
imgd.php and add the querystring
?src=kodim23.png&width=200. You should get a image like this.
And now you should really start to read the documentation, really.
Move on to read the documentation.