Cleaner image metadata read

This commit is contained in:
catboxanon 2023-05-24 16:41:22 -04:00 committed by GitHub
parent a6e653be26
commit 7a1bbf99da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -665,9 +665,13 @@ def read_info_from_image(image):
items['exif comment'] = exif_comment items['exif comment'] = exif_comment
geninfo = exif_comment geninfo = exif_comment
for field in ['jfif', 'jfif_version', 'jfif_unit', 'jfif_density', 'dpi', 'exif', for field in ['jfif', 'jfif_version', 'jfif_unit', 'jfif_density', 'dpi', 'exif',
'loop', 'background', 'timestamp', 'duration']: 'loop', 'background', 'timestamp', 'duration', 'progressive', 'progression',
'icc_profile', 'chromaticity']:
try:
items.pop(field, None) items.pop(field, None)
except KeyError:
pass
if items.get("Software", None) == "NovelAI": if items.get("Software", None) == "NovelAI":
try: try: