fix: [exifs module] Mp4 UnidentifiedImageError

This commit is contained in:
terrtia 2024-12-11 10:13:11 +01:00
parent f4584f7e98
commit 6f964d7f8b
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -12,7 +12,7 @@ The Exif Module
import os
import sys
from PIL import Image, ExifTags
from PIL import Image, ExifTags, UnidentifiedImageError
sys.path.append(os.environ['AIL_BIN'])
##################################
@ -38,6 +38,7 @@ class Exif(AbstractModule):
def compute(self, message):
image = self.get_obj()
print(image)
try:
img = Image.open(image.get_filepath())
img_exif = img.getexif()
print(img_exif)
@ -54,6 +55,8 @@ class Exif(AbstractModule):
print(f'{key}:{val}')
self.logger.critical(f'{key}:{val}')
sys.exit(0)
except UnidentifiedImageError:
self.logger.info(f'Invalid image: {image.get_filepath()}')
# tag = 'infoleak:automatic-detection="cve"'
# Send to Tags Queue