mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 13:22:51 +00:00
修改操作系统兼容图片裁剪
This commit is contained in:
parent
963a44a123
commit
29ddcbb7b2
@ -159,7 +159,9 @@ class UploadService
|
|||||||
*/
|
*/
|
||||||
public static function thumb($filePath, $ratio=5, $pre='s_')
|
public static function thumb($filePath, $ratio=5, $pre='s_')
|
||||||
{
|
{
|
||||||
$filePath = ltrim($filePath,'/');
|
$uname=php_uname('s');
|
||||||
|
if(strstr($uname,'Windows')!==false) $filePath = ltrim($filePath,'\\');
|
||||||
|
else $filePath = ltrim($filePath,'/');
|
||||||
$img = self::openImage($filePath);
|
$img = self::openImage($filePath);
|
||||||
$width = $img->width() * $ratio / 10;
|
$width = $img->width() * $ratio / 10;
|
||||||
$height = $img->height() * $ratio / 10;
|
$height = $img->height() * $ratio / 10;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user