|
@@ -315,13 +315,13 @@ class CosService |
|
@@ -315,13 +315,13 @@ class CosService |
|
315
|
|
315
|
|
|
316
|
/**
|
316
|
/**
|
|
317
|
* @remark :获取cos图片高度
|
317
|
* @remark :获取cos图片高度
|
|
318
|
- * @name :cropAndUploadFromCos
|
318
|
+ * @name :getImageHeight
|
|
319
|
* @author :lyh
|
319
|
* @author :lyh
|
|
320
|
* @method :post
|
320
|
* @method :post
|
|
321
|
* @time :2025/5/8 10:58
|
321
|
* @time :2025/5/8 10:58
|
|
322
|
- * @param :pathUrl->存储桶路径
|
322
|
+ * @param :pathUrl->存储桶相对路径
|
|
323
|
*/
|
323
|
*/
|
|
324
|
- public function getImageHeight($pathUrl,$maxHeight = 300){
|
324
|
+ public function getImageHeight($pathUrl){
|
|
325
|
$cos = config('filesystems.disks.cos');
|
325
|
$cos = config('filesystems.disks.cos');
|
|
326
|
$url = 'https://' . $cos['bucket'] . '.cos.' . $cos['region'] . '.myqcloud.com/' . ltrim($pathUrl, '/') . '?image/info';
|
326
|
$url = 'https://' . $cos['bucket'] . '.cos.' . $cos['region'] . '.myqcloud.com/' . ltrim($pathUrl, '/') . '?image/info';
|
|
327
|
$imageInfo = @getimagesize($url);
|
327
|
$imageInfo = @getimagesize($url);
|
|
@@ -340,10 +340,9 @@ class CosService |
|
@@ -340,10 +340,9 @@ class CosService |
|
340
|
* @method :post
|
340
|
* @method :post
|
|
341
|
* @time :2025/5/8 11:06
|
341
|
* @time :2025/5/8 11:06
|
|
342
|
*/
|
342
|
*/
|
|
343
|
- public function cropCosImage($cosUrl,$height = 200)
|
343
|
+ public function cropCosImage($cosUrl,$height = 220)
|
|
344
|
{
|
344
|
{
|
|
345
|
$cos = config('filesystems.disks.cos');
|
345
|
$cos = config('filesystems.disks.cos');
|
|
346
|
- // 初始化 COS 客户端
|
|
|
|
347
|
$cosClient = new Client([
|
346
|
$cosClient = new Client([
|
|
348
|
'region' => $cos['region'],
|
347
|
'region' => $cos['region'],
|
|
349
|
'credentials' => [
|
348
|
'credentials' => [
|