Updated debug info

This commit is contained in:
Rhet Turnbull
2022-02-22 09:49:02 -08:00
committed by GitHub
parent 39ba17dd1c
commit 6cb7dedd9b

View File

@@ -232,7 +232,7 @@ class ExifTool:
self.error = None self.error = None
# if running as a context manager, self._context_mgr will be True # if running as a context manager, self._context_mgr will be True
self._context_mgr = False self._context_mgr = False
self._exiftoolproc = _ExifToolProc(exiftool=exiftool) self._exiftoolproc = _ExifToolProc(exiftool=exiftool, debug=debug)
self._read_exif() self._read_exif()
@property @property
@@ -411,6 +411,8 @@ class ExifTool:
""" """
json_str, _, _ = self.run_commands("-json") json_str, _, _ = self.run_commands("-json")
if not json_str: if not json_str:
if self.debug:
logging.debug(f"empty json_str")
return dict() return dict()
json_str = unescape_str(json_str.decode("utf-8")) json_str = unescape_str(json_str.decode("utf-8"))
@@ -419,6 +421,8 @@ class ExifTool:
except Exception as e: except Exception as e:
# will fail with some commands, e.g --ext AVI which produces # will fail with some commands, e.g --ext AVI which produces
# 'No file with specified extension' instead of json # 'No file with specified extension' instead of json
if self.debug:
logging.debug(f"json.loads error {e}")
return dict() return dict()
exifdict = exifdict[0] exifdict = exifdict[0]
if not tag_groups: if not tag_groups: