CImage and img.php

CImage and 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.

The script 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.


├── img
│   └── kodim23.png
└── imgd.php

Get the img.php in an all-included-bundle together with a test image and create the cache directory.

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.

#Learn more

Move on to read the documentation.