Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local缩略图功能提升 #1044

Merged
merged 6 commits into from
Nov 11, 2021
Merged

local缩略图功能提升 #1044

merged 6 commits into from
Nov 11, 2021

Conversation

kikoqiu
Copy link
Contributor

@kikoqiu kikoqiu commented Nov 5, 2021

"github.com/nfnt/resize"换成 "golang.org/x/image/draw",因为前者已经不维护了。
修复当批量重新生成本地缩略图时,oom崩溃——添加了并发限制,默认为cpu核心数,可配置
添加了local缩略图生成后强制GC,添加配置项,默认false
local缩略图可配置编码方式,默认jpg并设置85。

MaxTaskCount: -1,
EncodeMethod: "jpg",
GCAfterGen: false,
EncodeQuality: 85,

Replace "github.com/nfnt/resize" with "golang.org/x/image/draw". Add thumb task queue to avoid oom when batch thumb operation
func (pool *Pool) releaseWorker() {
util.Log().Debug("Thumb任务队列,releaseWorker")
<-pool.worker
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any Unit Tests for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 cases added

@HFO4 HFO4 merged commit 54ed7e4 into cloudreve:master Nov 11, 2021
@HFO4
Copy link
Member

HFO4 commented Nov 11, 2021

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants