Only print .jpg/.png even with -file cmdarg

This commit is contained in:
Wouter Groeneveld 2023-03-18 08:49:08 +01:00
parent 6241c45c87
commit 8730d2c29f
1 changed files with 5 additions and 0 deletions

View File

@ -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)