fixed a bug in first start where CurrentColor was IMRead when it didn't exist yet
This commit is contained in:
parent
35d1a75eda
commit
409556604e
2 changed files with 7 additions and 4 deletions
3
main.go
3
main.go
|
@ -57,6 +57,9 @@ func (server Server) stream(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !stream.CurrentColorInstantPathExists() {
|
||||||
|
return
|
||||||
|
}
|
||||||
mat := stream.IMReadCurrentColor()
|
mat := stream.IMReadCurrentColor()
|
||||||
|
|
||||||
jpg, err := gocv.IMEncode(".jpg", mat)
|
jpg, err := gocv.IMEncode(".jpg", mat)
|
||||||
|
|
|
@ -20,7 +20,7 @@ type Stream struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Base64 string `json:"base64"`
|
Base64 string `json:"base64"`
|
||||||
Interval int `json:"interval"`
|
Interval int `json:"interval"`
|
||||||
FileLock sync.Mutex
|
FileLock sync.Mutex `json:"lock"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStream creates a new Stream Object
|
// NewStream creates a new Stream Object
|
||||||
|
|
Loading…
Add table
Reference in a new issue