更新:图片处理文件更新访问根目录为wwwroot

virtual
zwesy 2020-12-10 17:36:21 +08:00
parent 66047618a4
commit c49f41ffc5
1 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ class Image extends File
public static function resize($src)
{
$max = 1920;
$realPath = app()->getRootPath() . 'public/' . ltrim($src,'/');
$realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src,'/');
if(is_file($realPath)){
$img = TImage::open($realPath);
list($img_w,$img_h) = $img->size();
@ -34,7 +34,7 @@ class Image extends File
$rootPath = app()->getRootPath();
if(!empty($src)){
$system = System::getSystem();
$realPath = $rootPath . 'public/' . ltrim($src, '/');
$realPath = $rootPath . 'wwwroot/' . ltrim($src, '/');
if(is_file($realPath)){
if($system['is_mark']){
$mark = $rootPath . ltrim($system['mark_img'], '/');
@ -73,7 +73,7 @@ class Image extends File
public static function delImg($src)
{
if(!empty(trim($src))){
$realPath = app()->getRootPath() . 'public/' . ltrim($src, '/');
$realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src, '/');
if (file_exists($realPath)) {
$info = pathinfo($realPath);
$source = $info['dirname'] . DIRECTORY_SEPARATOR . $info['filename'] . '*.' . $info['extension'];
@ -100,7 +100,7 @@ class Image extends File
return '';
}
$rootPath = app()->getRootPath();
$realPath = $rootPath . 'public/' . ltrim($src, '/');
$realPath = $rootPath . 'wwwroot/' . ltrim($src, '/');
$realPath = str_replace('\\', '/', $realPath);
if(!file_exists($realPath)){
return '';
@ -120,7 +120,7 @@ class Image extends File
return $src;
}
$thumbName = $info['dirname']. DIRECTORY_SEPARATOR .$info['filename'].'_'.$width.'_'.$height.'.'.$info['extension'];
$realThumbName = $rootPath . 'public/' . ltrim($thumbName, '/');
$realThumbName = $rootPath . 'wwwroot/' . ltrim($thumbName, '/');
$realThumbName = str_replace('\\', '/', $realThumbName);
if(!file_exists($realThumbName)){
$image = TImage::open($realPath);