コード例 #1
0
ファイル: ImageImagick.class.php プロジェクト: AxelPanda/ibos
 public function open($imgname)
 {
     if (!is_file($imgname)) {
         throw new Exception("不存在的图像文件");
     }
     empty($this->img) || $this->img->destroy();
     $this->img = new Imagick(realpath($imgname));
     $this->info = array("width" => $this->img->getImageWidth(), "height" => $this->img->getImageHeight(), "type" => strtolower($this->img->getImageFormat()), "mime" => $this->img->getImageMimeType());
 }
コード例 #2
0
ファイル: Imagick.class.php プロジェクト: a3147972/wswl
 /**
  * 打开一张图像
  * @param  string $imgname 图像路径
  */
 public function open($imgname)
 {
     //检测图像文件
     if (!is_file($imgname)) {
         throw new Exception('不存在的图像文件');
     }
     //销毁已存在的图像
     empty($this->img) || $this->img->destroy();
     //载入图像
     $this->img = new \Imagick(realpath($imgname));
     //设置图像信息
     $this->info = array('width' => $this->img->getImageWidth(), 'height' => $this->img->getImageHeight(), 'type' => strtolower($this->img->getImageFormat()), 'mime' => $this->img->getImageMimeType());
 }
コード例 #3
0
ファイル: BaseModelImage.php プロジェクト: az0ne/diaoyu
 /**
  * 获取图片高度
  */
 public function getHeight()
 {
     return self::$resource->getImageHeight();
 }
コード例 #4
0
ファイル: Imagick.php プロジェクト: unpush/p2-php
 /**
  * stamp gif caution mark.
  *
  * @param resource $thumb
  * @return resource
  */
 protected function _decorateGifCaution($thumb)
 {
     $deco = new Imagick();
     $deco->readImage($this->getDecorateGifCautionFilePath());
     $thumb->compositeImage($deco, Imagick::COMPOSITE_OVER, ($thumb->getImageWidth() - $deco->getImageWidth()) / 2, ($thumb->getImageHeight() - $deco->getImageHeight()) / 2);
     $deco->destroy();
     return $thumb;
 }