1
0

seed can be specified to reproduce output

This commit is contained in:
2022-05-02 20:29:22 +02:00
parent 67274a5699
commit 12dd4e7512
3 changed files with 12 additions and 2 deletions

2
fs.go
View File

@ -7,7 +7,6 @@ import (
"os"
"path/filepath"
"strings"
"time"
)
// load an image from a file into an Image value
@ -52,7 +51,6 @@ func getImagesList(path string) []string {
// Randomly choose x number of image from a given folder
func getRandomImage() string {
rand.Seed(time.Now().UnixNano())
dir := getImagesList(ConfigRegister.InputDir)
index := rand.Intn(len(dir))
return dir[index]