本文整理匯總了PHP中SimpleImage::resizepic方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleImage::resizepic方法的具體用法?PHP SimpleImage::resizepic怎麽用?PHP SimpleImage::resizepic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::resizepic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fixPhoto
public function fixPhoto($filename,$filenamepre,$filenamethb) {
$image = new SimpleImage(); // instantiate image manipulation class
$image->load($filenamepre); // load source image
if (($image->getWidth()>$this->settings->previewwidth) || ($image->getHeight()>$this->settings->previewheight)) {
$image->load($filename); // load source image
$image->resizepic(
$this->settings->previewwidth,
$this->settings->previewheight
); // resize to height as desired in technical requirements
$image->save($filenamepre); // save resized file to disk
}
$image->load($filenamethb); // load source image
if (($image->getWidth()>$this->settings->thumbwidth) || ($image->getHeight()>$this->settings->thumbheight)) {
$image->load($filename); // load source image
$image->resizepic(
$this->settings->thumbwidth,
$this->settings->thumbheight
); // resize to height as desired in technical requirements
$image->save($filenamethb); // save resized file to disk
}
}