示例#1
0
 public static function makeThumb($attach, $width, $height)
 {
     $attachUrl = FileUtil::getAttachUrl();
     $file = sprintf("%s/%s", $attachUrl, $attach["attachment"]);
     $fileext = StringUtil::getFileExt($file);
     $thumbName = self::getThumbName($attach, $width, $height);
     if (LOCAL) {
         $res = ImageUtil::thumb2($file, $thumbName, "", $width, $height);
     } else {
         $tempFile = FileUtil::getTempPath() . "tmp." . $fileext;
         $orgImgname = Ibos::engine()->IO()->file()->fetchTemp(FileUtil::fileName($file), $fileext);
         ImageUtil::thumb2($orgImgname, $tempFile, "", $width, $height);
         FileUtil::createFile($thumbName, file_get_contents($tempFile));
     }
     return $thumbName;
 }