Skip to content

Commit

Permalink
Merge pull request #86 from will-moore/favicon_placeholder
Browse files Browse the repository at this point in the history
fix return of default favicon if not found
  • Loading branch information
will-moore authored Nov 7, 2024
2 parents 3a505e4 + 8281624 commit d9953e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions omero_mapr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,11 @@ def mapannotations_favicon(request, conn=None, **kwargs):
cache.hset('favdomain', _cache_key, icon)
finally:
r.connection.close()
return HttpJPEGResponse(icon)
if icon is not None:
return HttpJPEGResponse(icon)

with Image.open(mapr_settings.DEFAULT_FAVICON) as img:
img.thumbnail((16, 16), Image.ANTIALIAS)
img.thumbnail((16, 16))
f = BytesIO()
img.save(f, "PNG")
f.seek(0)
Expand Down

0 comments on commit d9953e4

Please sign in to comment.