$fileFormat = explode('|', $kekezu->_sys_config['file_type']); $maxSize = intval($kekezu->_sys_config['max_size']) * 1024 * 1024; $pathDir = setUploadPath($fileType, $objType); $upload = new keke_upload_class(S_ROOT . $pathDir, $fileFormat, $maxSize); $savename = $upload->run($filename, 1); if (!is_array($savename)) { $err = $msg = $savename; echo json_encode(array('err' => $err, 'msg' => $msg)); die; } else { $name = $savename[0]['name']; $path = $pathDir . $savename[0]['saveName']; if ($fileType == 'service') { $size_a = array(100, 100); $size_b = array(210, 210); $result = keke_img_class::resize($path, $size_a, $size_b, true); } if ($fileType != 'sys') { keke_glob_class::waterMark($path); } $savefilename = $savename[0]['name']; } } if (strtoupper(CHARSET) == 'GBK') { $savefilename = kekezu::utftogbk($savefilename); } $data = array(); $data['file_name'] = $savefilename; $data['save_name'] = $path; $data['uid'] = $gUid; $data['username'] = $gUsername;
static function output_pics($path, $pre = null, $show = false) { $tmp = explode(',', $path . ','); $tmp = array_unique(array_filter($tmp)); if ($tmp) { $s = sizeof($tmp); if ($show) { return keke_img_class::get_filepath_by_size($tmp[$s - 1], $pre); } else { for ($i = 0; $i < $s; $i++) { $tmp[$i] = keke_img_class::get_filepath_by_size($tmp[$i], $pre); } return $tmp; } } return keke_img_class::get_filepath_by_size('', $pre); }
private static function init_img_info($image) { $img_arr = getimagesize($image); if (!$img_arr) { return false; } self::$_img_width = $img_arr[0] ? $img_arr[0] : false; self::$_img_height = $img_arr[1] ? $img_arr[1] : false; self::$_img_type = $img_arr[2] ? $img_arr[2] : false; }