From 4816f8ee0363fd994aa867a98fd9a2bae9e29e27 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Mon, 7 Aug 2023 18:37:32 +0800 Subject: [PATCH] fix: optimize thumbnails --- pkg/common/db/s3/oss/oss.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/common/db/s3/oss/oss.go b/pkg/common/db/s3/oss/oss.go index c8d59bc64..a63e9f515 100644 --- a/pkg/common/db/s3/oss/oss.go +++ b/pkg/common/db/s3/oss/oss.go @@ -290,10 +290,10 @@ func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration, } // https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/resize,h_100,m_lfit process := "image/resize,m_lfit" - if opt.Video.Width > 0 { + if opt.Image.Width > 0 { process += ",w_" + strconv.Itoa(opt.Image.Width) } - if opt.Video.Height > 0 { + if opt.Image.Height > 0 { process += ",h_" + strconv.Itoa(opt.Image.Height) } process += ",format," + format @@ -319,7 +319,6 @@ func (o *OSS) AccessURL(ctx context.Context, name string, expire time.Duration, process += ",h_" + strconv.Itoa(opt.Video.Height) } process += ",m_fast" - fmt.Println(process) opts = append(opts, oss.Process(process)) } if opt.ContentType != "" {