Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fnwinter committed Sep 17, 2024
1 parent 52a5476 commit 558b80c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cnas/genhtml/navibar_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, *args, **kwargs):

def set_menu(self, drop_menu):
assert drop_menu, "No drop down menu"
assert isinstance(drop_menu) == isinstance({}), "Drop down menu should be dict type"
assert isinstance(drop_menu, dict), "Drop down menu should be dict type"

self.drop_list = []
for _title, _url in drop_menu.items():
Expand Down
6 changes: 3 additions & 3 deletions cnas/service/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ def correct_image_orientation(image):
return image

ORIENTATION = "Orientation"
_orientation = _exif.get(ORIENTATION) if _exif.has(ORIENTATION) else 0
_orientation = _exif.get(ORIENTATION)

if _orientation == 3:
image = image.rotate(180, expand=True)
elif _orientation == 6:
image = image.rotate(270, expand=True)
elif _orientation == 8:
image = image.rotate(90, expand=True)
except (AttributeError, KeyError, IndexError):
print("error while rotating tumbnail")
except (AttributeError, KeyError, IndexError) as e:
print(f"error while rotating tumbnail {e}")

return image

Expand Down

0 comments on commit 558b80c

Please sign in to comment.