本文整理匯總了PHP中image::getImageWidth方法的典型用法代碼示例。如果您正苦於以下問題:PHP image::getImageWidth方法的具體用法?PHP image::getImageWidth怎麽用?PHP image::getImageWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類image
的用法示例。
在下文中一共展示了image::getImageWidth方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: uploadFile
function uploadFile($filepath)
{
// getting paths
$uploadedfile = $filepath;
$uploaddir = $this->uploadDir;
// creating Directory of logged in userid
$dir = $_SESSION['foongigs_userid'];
if ($dir) {
if (!file_exists($uploaddir . $dir . "/")) {
mkdir($uploaddir . $dir . "/", 0777);
}
}
// creating files
$image = new image($imagepath);
$this->randfilename = $image->getFileName();
$this->fileext = $image->getFileExtension();
$this->width = $image->getImageHeight();
$this->height = $image->getImageWidth();
for ($i = 0; $i < count($size); $i++) {
$dimension = explode("x", $size[$i]);
$destination = $uploaddir . $dir . "/" . $this->randfilename . "_" . $size[$i] . "." . $this->fileext;
$image->createAndResize($destination, $dimension[0], $dimension[1], $this->imageQuality);
}
// Upload Original File....
$destination = $uploaddir . $dir . "/" . $this->randfilename . "_original" . "." . $this->fileext;
$image->moveTo($destination);
}
示例2: getWidth
/**
* 獲得圖像寬度
*
* @return int 圖像寬度
*/
function getWidth()
{
return $this->image->getImageWidth();
}