mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-08 23:18:19 -07:00
fix(#46): infer resize operation
This commit is contained in:
parent
4678a066b6
commit
9db6f2a0ea
3 changed files with 78 additions and 37 deletions
6
vips.go
6
vips.go
|
|
@ -78,11 +78,12 @@ func Initialize() {
|
|||
C.vips_cache_set_max_mem(maxCacheMem)
|
||||
C.vips_cache_set_max(maxCacheSize)
|
||||
|
||||
// Define a custom libvips thread concurrency limit (this may generate thread-unsafe issues)
|
||||
// Define a custom thread concurrency limit in libvips (this may generate thread-unsafe issues)
|
||||
// See: https://github.com/jcupitt/libvips/issues/261#issuecomment-92850414
|
||||
if os.Getenv("VIPS_CONCURRENCY") == "" {
|
||||
C.vips_concurrency_set(1)
|
||||
}
|
||||
|
||||
// Enable libvips cache tracing
|
||||
if os.Getenv("VIPS_TRACE") != "" {
|
||||
C.vips_enable_cache_set_trace()
|
||||
|
|
@ -91,7 +92,8 @@ func Initialize() {
|
|||
initialized = true
|
||||
}
|
||||
|
||||
// Thread-safe function to shutdown libvips. You could call this to drop caches as well.
|
||||
// Thread-safe function to shutdown libvips.
|
||||
// You can call this to drop caches as well.
|
||||
// If libvips was already initialized, the function is no-op
|
||||
func Shutdown() {
|
||||
m.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue