__author__ = "Peter Molnar" __copyright__ = "Copyright 2017-2019, Peter Molnar" __license__ = "apache-2.0" __maintainer__ = "Peter Molnar" __email__ = "mail@petermolnar.net" import re import subprocess import json import os import logging from tempfile import gettempdir TMPSUBDIR = "nasg" SHM = "/dev/shm" if os.path.isdir(SHM) and os.access(SHM, os.W_OK): TMPDIR = f"{SHM}/{TMPSUBDIR}" else: TMPDIR = os.path.join(gettempdir(), TMPSUBDIR) if not os.path.isdir(TMPDIR): os.makedirs(TMPDIR) EXIFDATE = re.compile( r"^(?P[0-9]{4}):(?P[0-9]{2}):(?P[0-9]{2})\s+" r"(?P