本文整理汇总了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
}
}