Resizes images, intelligently sharpens, crops based on width:height ratios, color fills transparent GIFs and PNGs, and caches variations for optimal performance. Like this:
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/
» Discuss it here
NOTE: This plugin was developed for Siena. It will probably work in older versions too, but I didn't test it with those versions.
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 in the download file.
Add these rewrite rules to Cotonti's .htaccess file:
RewriteRule ^image/([0-9]{1,4})x([0-9]{1,4})/([0-9]{1}):([0-9]{1})/(.*)\.(gif|jpg|jpeg|png)$ plug.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)$ plug.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
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" />
Bedankt: 2 tijden
Bedankt: 52 tijden
I've updated the download file to incorporate this fix.
Bedankt: 3 tijden
for genoa u would have to:
[BEGIN_COT_EXT] replace with: [BEGIN_SED_EXTPLUGIN]
[END_COT_EXT] replace with: [END_SED_EXTPLUGIN]
[BEGIN_COT_EXT_CONFIG] replace with: [BEGIN_SED_EXTPLUGIN_CONFIG]
[END_COT_EXT_CONFIG] replace with: [END_SED_EXTPLUGIN_CONFIG]
its not tested :p just the idea ;p