mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 05:32:02 +08:00
refactor(encoder): optimize extra image processing parameters handling
This commit is contained in:
parent
ffa5242983
commit
e11cd575c8
@ -216,6 +216,8 @@ func preProcessImage(img *vips.ImageRef, imageType string, extraParams config.Ex
|
||||
|
||||
// 额外参数处理
|
||||
if config.Config.EnableExtraParams {
|
||||
// 检查是否需要进行尺寸调整
|
||||
if extraParams.MaxWidth != 0 || extraParams.MaxHeight != 0 || extraParams.Width != 0 || extraParams.Height != 0 {
|
||||
log.Debug("开始应用额外图像处理参数")
|
||||
if err := resizeImage(img, extraParams); err != nil {
|
||||
log.Errorf("应用额外图像处理参数失败: %v", err)
|
||||
@ -223,6 +225,9 @@ func preProcessImage(img *vips.ImageRef, imageType string, extraParams config.Ex
|
||||
return shouldCopyOriginal, err
|
||||
}
|
||||
log.Debug("额外图像处理参数应用完成")
|
||||
} else {
|
||||
log.Debug("未设置任何尺寸参数,跳过图像尺寸调整")
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug("图像预处理完成")
|
||||
|
Loading…
x
Reference in New Issue
Block a user