diff --git a/app/scodoc/sco_logos.py b/app/scodoc/sco_logos.py index 04be70bed..8f48f7443 100644 --- a/app/scodoc/sco_logos.py +++ b/app/scodoc/sco_logos.py @@ -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)