|
...
|
...
|
@@ -35,15 +35,10 @@ class CropImage extends Command |
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
echo '测试裁剪->cs-crop:'.PHP_EOL;
|
|
|
|
$images ='https://ecdn6.globalso.com/upload/p/1/image_other/2025-05/1746675561075.jpg';
|
|
|
|
$image = str_replace_url($images);
|
|
|
|
$cosService = new CosService();
|
|
|
|
$new_url = $cosService->cropAndUploadFromCos($image);
|
|
|
|
return $new_url;
|
|
|
|
// $project_id = $this->argument('project_id');
|
|
|
|
// ProjectServer::useProject($project_id);
|
|
|
|
// $this->_action();
|
|
|
|
// DB::disconnect('custom_mysql');
|
|
|
|
$project_id = $this->argument('project_id');
|
|
|
|
ProjectServer::useProject($project_id);
|
|
|
|
$this->_action($project_id);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -60,8 +55,9 @@ class CropImage extends Command |
|
|
|
foreach ($data as $val){
|
|
|
|
//处理图片为相对路径
|
|
|
|
$image = str_replace_url($val);
|
|
|
|
$new_url = $cosService->cropAndUploadFromCos($image);
|
|
|
|
echo '返回的图片路径:'.$new_url.PHP_EOL;
|
|
|
|
$height = $cosService->getImageHeight($image);
|
|
|
|
echo '返回的图片高度:'.$height.PHP_EOL;
|
|
|
|
$cosService->cropCosImage($image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
...
|
...
|
|