コード例 #1
0
ファイル: block.thumbnail.php プロジェクト: sd-studio/or
function smarty_block_thumbnail($params, $content, &$smarty, &$repeat)
{
    if (isset($content)) {
        $thumb = new cf\Thumbnail($content, $params['width'], $params['height']);
        return $thumb->url();
    }
}
コード例 #2
0
ファイル: image.php プロジェクト: sd-studio/or
function getThumbnail($path, $width, $height)
{
    if (!$path) {
        return '';
    }
    \cf\Image::$USE_IMAGEMAGICK = \cf\Config::use_imagemagick;
    $thumb = new \cf\Thumbnail($_SERVER['DOCUMENT_ROOT'] . '/' . $path, $width, $height);
    return $thumb->url();
}