本文整理汇总了PHP中Picture::getPictureFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::getPictureFilename方法的具体用法?PHP Picture::getPictureFilename怎么用?PHP Picture::getPictureFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Picture
的用法示例。
在下文中一共展示了Picture::getPictureFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cacheIt
public function cacheIt($width = null, $height = null, $mode = 'equal')
{
$w = isset($width) ? $width : $this->m_width;
$h = isset($height) ? $height : $this->m_height;
$p = new Picture($this->m_filename);
if ($w == null && $h == null) {
$mode = 'equal';
}
$search_filename = Picture::getPictureFilename($this->m_filename, $w, $h, $mode);
if (!file_exists($search_filename)) {
switch ($mode) {
case 'redim':
$p->dimensionTo($w, $h);
break;
case 'crop':
$p->cropTo($w, $h);
break;
}
$p->toFile($search_filename);
}
if (file_exists($search_filename)) {
list($width, $height, $type, $attr) = getimagesize($search_filename);
return array('width' => $width, 'height' => $height);
}
}