soften error when logo not found

This commit is contained in:
Jean-Marie PLACE 2022-02-22 19:25:49 +01:00
parent e7b980bff7
commit 875c12d703
2 changed files with 3 additions and 2 deletions

View File

@ -276,7 +276,7 @@ class Logo:
if self.mm is None: if self.mm is None:
return f'<logo name="{self.logoname}" width="?? mm" height="?? mm">' return f'<logo name="{self.logoname}" width="?? mm" height="?? mm">'
else: else:
return f'<logo name="{self.logoname}" width="{self.mm[0]}mm"">' return f'<logo name="{self.logoname}" width="{self.mm[0]}mm">'
def last_modified(self): def last_modified(self):
path = Path(self.filepath) path = Path(self.filepath)

View File

@ -304,8 +304,9 @@ def _return_logo(name="header", dept_id="", small=False, strict: bool = True):
# stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici # stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici
# from app.scodoc.sco_photos import _http_jpeg_file # from app.scodoc.sco_photos import _http_jpeg_file
logo = sco_logos.find_logo(name, dept_id, strict).select() logo = sco_logos.find_logo(name, dept_id, strict)
if logo is not None: if logo is not None:
logo.select()
suffix = logo.suffix suffix = logo.suffix
if small: if small:
with PILImage.open(logo.filepath) as im: with PILImage.open(logo.filepath) as im: