Add check for image
This commit is contained in:
parent
388545f613
commit
ec0ebae683
1 changed files with 37 additions and 34 deletions
|
@ -72,6 +72,7 @@ class image_classifier:
|
|||
if not os.access(file, os.R_OK):
|
||||
self._log.error(f"The file '{file}' is not readable.")
|
||||
else:
|
||||
if self.is_image(file):
|
||||
self.metadata = pyexiv2.ImageMetadata(file)
|
||||
self.metadata.read()
|
||||
dirname = os.path.dirname(os.path.realpath(file))
|
||||
|
@ -107,6 +108,8 @@ class image_classifier:
|
|||
shutil.move(file, new_path)
|
||||
else:
|
||||
self._log.info(f"NOT moving file '{file}' to '{new_path}' because of --no-move")
|
||||
else:
|
||||
self._log.debug(f"The file '{file}' is not an image.")
|
||||
|
||||
def print_metadata(self):
|
||||
print("IPTC keys:")
|
||||
|
|
Loading…
Reference in a new issue