Browse Source

Check presets after vips init

DarthSim 5 years ago
parent
commit
1383bf2788
2 changed files with 5 additions and 4 deletions
  1. 0 4
      config.go
  2. 5 0
      main.go

+ 0 - 4
config.go

@@ -458,10 +458,6 @@ func configure() {
 		conf.GCSEnabled = true
 		conf.GCSEnabled = true
 	}
 	}
 
 
-	if err := checkPresets(conf.Presets); err != nil {
-		logFatal(err.Error())
-	}
-
 	if conf.WatermarkOpacity <= 0 {
 	if conf.WatermarkOpacity <= 0 {
 		logFatal("Watermark opacity should be greater than 0")
 		logFatal("Watermark opacity should be greater than 0")
 	} else if conf.WatermarkOpacity > 1 {
 	} else if conf.WatermarkOpacity > 1 {

+ 5 - 0
main.go

@@ -24,6 +24,11 @@ func initialize() {
 	initDownloading()
 	initDownloading()
 	initErrorsReporting()
 	initErrorsReporting()
 	initVips()
 	initVips()
+
+	if err := checkPresets(conf.Presets); err != nil {
+		shutdownVips()
+		logFatal(err.Error())
+	}
 }
 }
 
 
 func main() {
 func main() {