本文整理汇总了PHP中resource::getImageHeight方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::getImageHeight方法的具体用法?PHP resource::getImageHeight怎么用?PHP resource::getImageHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resource
的用法示例。
在下文中一共展示了resource::getImageHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: open
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: open
/**
* 打开一张图像
* @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: getHeight
/**
* 获取图片高度
*/
public function getHeight()
{
return self::$resource->getImageHeight();
}
示例4: _decorateGifCaution
/**
* 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;
}