Only print .jpg/.png even with -file cmdarg
This commit is contained in:
parent
6241c45c87
commit
8730d2c29f
5
main.go
5
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)
|
||||
|
|
Loading…
Reference in New Issue