diff --git a/config.go b/config.go index b7cafe9..66d0787 100644 --- a/config.go +++ b/config.go @@ -9,6 +9,7 @@ import ( type Config struct { Method string `json:method` OutputDir string `json:outputdir` + InputDir string `json:inputdir` BaseImage string `json:baseimage` } diff --git a/fs.go b/fs.go index dfaf66e..0908096 100644 --- a/fs.go +++ b/fs.go @@ -53,7 +53,7 @@ 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("/home/gator/Photos/") + dir := getImagesList(ConfigRegister.InputDir) index := rand.Intn(len(dir)) return dir[index] } diff --git a/main.go b/main.go index 6c53690..6d90fa4 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ func main() { // command line arguments flag.StringVar(&ConfigRegister.Method, "blending", "darken", "Blending methods : darken, lighten, fuckyfun") flag.StringVar(&ConfigRegister.OutputDir, "output", "./", "Output directory") + flag.StringVar(&ConfigRegister.InputDir, "input", "/home/gator/Photos", "Input directory. Where to look the images from") flag.StringVar(&ConfigRegister.BaseImage, "base-img", "", "Path to the base image to work with. Random image if not set") flag.Parse()