Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit 8166fd1380 - Show all commits

View File

@ -117,7 +117,11 @@ class Logo:
os.mkdir(self.dirpath)
def create(self, stream):
img_type = guess_image_type(stream)
"enregistre logo"
try:
img_type = guess_image_type(stream)
except ValueError as exc:
raise ScoValueError("fichier logo invalide") from exc
if img_type not in scu.LOGOS_IMAGES_ALLOWED_TYPES:
raise ScoValueError(f"type d'image invalide ({img_type})")
self._set_format(img_type)