コード例 #1
0
ファイル: resizer.php プロジェクト: raffpaquin/Gregory
/*
 *
 * Load configuration
 *
 */
$config = array_merge(array('path' => dirname(__FILE__), 'cachePath' => dirname(__FILE__) . '/_cache', 'quality' => 90, 'cache' => true, 'memory_limit' => '768M', 'size' => array()), $config);
if (!isset($config['size']['thumb'])) {
    $config['size']['thumb'] = array('width' => 50, 'height' => 50, 'ratio' => true);
}
/*
 *
 * Load ImageResizer
 *
 */
require dirname(__FILE__) . '/ImageResizer.php';
ImageResizer::setConfig($config);
/*
 *
 * Add resizer route
 *
 */
$this->addRoute(array('/resizer/*' => array('function' => 'resizer_route')));
/*
 *
 * Resizer route function
 *
 */
function resizer_route($route)
{
    if (!isset($route['params']['wildcard'])) {
        return false;