浏览代码

Add vips debug flag

DarthSim 7 年之前
父节点
当前提交
02a9ed4210
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      process.go

+ 6 - 0
process.go

@@ -11,6 +11,7 @@ import (
 	"errors"
 	"log"
 	"math"
+	"os"
 	"runtime"
 	"unsafe"
 )
@@ -91,6 +92,11 @@ func initVips() {
 	C.vips_cache_set_max_mem(100 * 1024 * 1024) // 100Mb
 	C.vips_cache_set_max(500)
 
+	if len(os.Getenv("IMGPROXY_DEBUG_VIPS")) > 0 {
+		C.vips_cache_set_dump(C.gboolean(1))
+		C.vips_cache_set_trace(C.gboolean(1))
+	}
+
 	vipsSupportSmartcrop = C.vips_support_smartcrop() == 1
 }