/** * Constructor * * @param array $config */ public function __construct(array $config) { parent::__construct($config); //インストールチェック if (!function_exists("cairo_create")) { trigger_error('Error: You need Cairo Library', E_ERROR); exit; } }
/** * Constructor * * @param array $config * * @throws BEAR_Img_Adapter_Magick_Exception */ public function __construct(array $config) { parent::__construct($config); //インストールチェック if (!class_exists('Imagick')) { throw $this->_exception('iMagick extention is not loaded'); } $this->adapter = new Imagick(); }
/** * 画像表示 * * ヘッダーと画像をhttp出力します。 * * @param string $format 画像ファイルの場所(URL or fileパス) * * @return void */ public function show($format = false) { // clean buffer ob_clean(); if (!$format) { $format = $this->format; } else { $format = strtolower($format); } // clean buffer ob_clean(); switch ($format) { case 'gif': $this->result = imagegif($this->_imgResource); break; case 'jpeg': $this->result = imagejpeg($this->_imgResource); break; case 'png': $this->result = imagepng($this->_imgResource); break; default: trigger_error('format error', $format, E_USER_ERROR); } $this->_log->log('IMG show', array('format' => $format, 'rsc' => (string) $this->_imgResource, 'result' => $this->result)); parent::header($format); }