From 8730d2c29f0f4cd9b418d142be29b5cd664fc795 Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Sat, 18 Mar 2023 08:49:08 +0100 Subject: [PATCH] Only print .jpg/.png even with -file cmdarg --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 5cf6cf9..56fb191 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,11 @@ func main() { if *file != "" { log.Printf("Attempting to print file %s...\n", *file) + if !isPossibleToPrint(*file) { + log.Fatalln("Cannot print, this is not a photo (.jpg/.png only!)") + os.Exit(1) + } + *dir = filepath.Join(os.TempDir(), "phomemo") os.Mkdir(*dir, os.ModePerm) // ignore error in case still existing err := copyFileToFolder(*file, *dir)