Added locking to exiftool
This commit is contained in:
@@ -17,6 +17,7 @@ import pathlib
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import threading
|
||||
from abc import ABC, abstractmethod
|
||||
from functools import lru_cache # pylint: disable=syntax-error
|
||||
|
||||
@@ -249,6 +250,7 @@ class ExifTool:
|
||||
self._exiftoolproc = _ExifToolProc(
|
||||
exiftool=exiftool, large_file_support=large_file_support
|
||||
)
|
||||
self._lock = threading.Lock()
|
||||
self._read_exif()
|
||||
|
||||
@property
|
||||
@@ -352,6 +354,7 @@ class ExifTool:
|
||||
if not commands:
|
||||
raise TypeError("must provide one or more command to run")
|
||||
|
||||
with self._lock:
|
||||
if self._context_mgr and self.overwrite:
|
||||
commands = list(commands)
|
||||
commands.append("-overwrite_original")
|
||||
|
||||
Reference in New Issue
Block a user