SLIR (Smart Lencioni Image Resizer)
===============================================================================

Resizes images, intelligently sharpens, crops based on width:height ratios,
color fills transparent GIFs and PNGs, and caches variations for optimal
performance.

This plugin is a Cotonti implementation of the SLIR script by Joe Lencioni.
For more info: http://code.google.com/p/smart-lencioni-image-resizer/


========== BASIC USAGE ========================================================
By default, the SLIR script is accessible through index.php?z=index&r=slir
This is because the plugin uses the ajax hook. For pre-Siena installations
it will be plugin.php?r=slir

The script takes the following query string parameters:
* 	w	Maximum width (integer)
* 	h	Maximum height (integer)
*	c	Crop ratio, like 1:1 or 3:4
*	q	Quality (integer, 0-100)
*	b	Background fill color (hexdec color code)
*	p	Progressive (1 or 0)

See below for examples. For more info see lib/slir.class.php


========== HOW TO GET NICE URLS ===============================================
Add these rewrite rules to Cotonti's .htaccess file:

~~~~~ For Siena ~~~~~
RewriteRule ^image/([0-9]{1,4})x([0-9]{1,4})/([0-9]{1}):([0-9]{1})/(.*)\.(gif|jpg|jpeg|png)$ index.php?z=index&r=slir&w=$1&h=$2&c=$3:$4&i=$5.$6 [NC,NE,QSA,L]
RewriteRule ^image/([0-9]{1,4})x([0-9]{1,4})/(.*)\.(gif|jpg|jpeg|png)$ index.php?z=index&r=slir&w=$1&h=$2&i=$3.$4 [NC,NE,QSA,L]

~~~~~ For Genoa and older versions ~~~~~
RewriteRule ^image/([0-9]{1,4})x([0-9]{1,4})/([0-9]{1}):([0-9]{1})/(.*)\.(gif|jpg|jpeg|png)$ plugin.php?r=slir&w=$1&h=$2&c=$3:$4&i=$5.$6 [NC,NE,QSA,L]
RewriteRule ^image/([0-9]{1,4})x([0-9]{1,4})/(.*)\.(gif|jpg|jpeg|png)$ plugin.php?r=slir&w=$1&h=$2&i=$3.$4 [NC,NE,QSA,L]

With these rules you can request an image like this:
http://www.example.com/image/120x200/datas/users/example.jpg

Or with a fixed crop ratio:
http://www.example.com/image/120x200/1:1/datas/users/example.jpg


========== EXAMPLES ===========================================================
Resizing a JPEG to a max width of 100 pixels and a max height of 100 pixels:
<img src="image/100x100/path/to/image.jpg" alt="Alt text" />

Resizing and cropping a JPEG into a square:
<img src="image/100x100/1:1/path/to/image.jpg" alt="Alt text" />