本文整理匯總了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;
}