basename should be dirname

This commit is contained in:
dadav 2020-04-15 08:20:47 +02:00
parent 8a07e822e6
commit 6805df858e

View File

@ -9,7 +9,7 @@ frame_lock = Lock()
def update_frame(img):
global frame_lock, frame_path, frame_format
if not os.path.exists(os.path.basename(frame_path)):
os.makedirs(os.path.basename(frame_path))
if not os.path.exists(os.path.dirname(frame_path)):
os.makedirs(os.path.dirname(frame_path))
with frame_lock:
img.save(frame_path, format=frame_format)