diff --git a/app/scodoc/sco_logos.py b/app/scodoc/sco_logos.py index 3f5917bb49..8aa88c5324 100644 --- a/app/scodoc/sco_logos.py +++ b/app/scodoc/sco_logos.py @@ -269,6 +269,11 @@ class Logo: else: return f'' + def last_modified(self): + path = Path(self.filepath) + dt = path.stat().st_mtime + return path.stat().st_mtime + def guess_image_type(stream) -> str: "guess image type from header in stream" diff --git a/app/views/scodoc.py b/app/views/scodoc.py index c46c4b3949..301dfbb4c2 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -215,7 +215,9 @@ SMALL_SIZE = (200, 200) def _return_logo(name="header", dept_id="", small=False, strict: bool = True): # stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici - logo = sco_logos.find_logo(name, dept_id, strict) + # from app.scodoc.sco_photos import _http_jpeg_file + + logo = sco_logos.find_logo(name, dept_id, strict).select() if logo is not None: suffix = logo.suffix if small: @@ -232,6 +234,8 @@ def _return_logo(name="header", dept_id="", small=False, strict: bool = True): stream.seek(0) return send_file(stream, mimetype=f"image/{fmt}") else: + # return _http_jpeg_file(logo.filepath) + # ... replaces ... return send_file( logo.filepath, mimetype=f"image/{suffix}",