mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-13 20:18:52 +02:00
fix(webp): fix issue with concurrent preparation of encoder.
This commit is contained in:
@@ -4,11 +4,16 @@ import (
|
||||
"github.com/belphemur/go-webpbin/v2"
|
||||
"image"
|
||||
"io"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const libwebpVersion = "1.6.0"
|
||||
|
||||
var prepareMutex sync.Mutex
|
||||
|
||||
func PrepareEncoder() error {
|
||||
prepareMutex.Lock()
|
||||
defer prepareMutex.Unlock()
|
||||
webpbin.SetLibVersion(libwebpVersion)
|
||||
container := webpbin.NewCWebP()
|
||||
return container.BinWrapper.Run()
|
||||
|
Reference in New Issue
Block a user