本文整理汇总了PHP中vB_Image::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_Image::__construct方法的具体用法?PHP vB_Image::__construct怎么用?PHP vB_Image::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vB_Image
的用法示例。
在下文中一共展示了vB_Image::__construct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor. Sets up resizable types, extensions, etc.
*
* @return void
*/
public function __construct($options)
{
parent::__construct($options);
$this->info_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true, 'psd' => true, 'bmp' => true, 'tiff' => true, 'tif' => true);
$this->thumb_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true);
$this->resize_types = array('JPEG' => true, 'PNG' => true, 'GIF' => true);
if (preg_match('~#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})~i', $this->options['thumbcolor'], $match)) {
$this->thumbcolor = array('r' => hexdec($match[1]), 'g' => hexdec($match[2]), 'b' => hexdec($match[3]));
}
}
示例2: __construct
/**
* Constructor
* Sets ImageMagick paths to convert and identify
*
* @return void
*/
public function __construct($options)
{
parent::__construct($options);
$path = preg_replace('#[/\\\\]+$#', '', $this->options['magickpath']);
if (preg_match('#^WIN#i', PHP_OS)) {
$this->identifypath = '"' . $path . '\\identify.exe"';
$this->convertpath = '"' . $path . '\\convert.exe"';
} else {
$this->identifypath = "'" . $path . "/identify'";
$this->convertpath = "'" . $path . "/convert'";
}
$this->must_convert_types = array('PSD' => true, 'BMP' => true, 'TIFF' => true, 'PDF' => true);
$this->resize_types = array('GIF' => true, 'JPEG' => true, 'PNG' => true, 'BMP' => true, 'TIFF' => true);
$this->thumb_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true, 'psd' => true, 'pdf' => true, 'bmp' => true, 'tiff' => true, 'tif' => true);
$this->info_extensions =& $this->thumb_extensions;
if (preg_match('~^#([0-9A-F]{6})$~i', $this->options['thumbcolor'], $match)) {
$this->thumbcolor = $match[0];
}
}