Skip to content

Commit

Permalink
set fixed HTML icon width
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Sep 22, 2023
1 parent 32df3a7 commit 7d1d96b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radiopadre/htmlfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _render_thumb_impl(self, width=None, height=None, refresh=False, **kw):
# make fresh image if we don't have a static one, or use_pngs is disabled
if not os.path.exists(img_representation) or not settings.html.use_pngs:
if settings.html.method == "icon":
return f"<a href='{document_url}' target='_blank'><img src='{_icon_url}' width={width} alt='?'></a>"
return f"<a href='{document_url}' target='_blank'><img src='{_icon_url}' width={64} alt='?'></a>"

img_representation, thumbnail_url, update = self._get_cache_file("html-render", "png",
keydict=dict(width=width, height=height))
Expand Down Expand Up @@ -147,7 +147,7 @@ def _render_thumb_impl(self, width=None, height=None, **kw):
filename = re.sub(r"[/:;&?#]", "_", self.url) + ".png"

if settings.hmtl.method == "icon":
return f"<a href='{self.url}' target='_blank'><img src='{_icon_url}' width={width} alt='?'></a>"
return f"<a href='{self.url}' target='_blank'><img src='{_icon_url}' width={64} alt='?'></a>"

basepath, baseurl = radiopadre.get_cache_dir("./.urls", "html-render") # fake ".urls" name which will be stripped
thumbnail = f"{basepath}/{filename}"
Expand Down

0 comments on commit 7d1d96b

Please sign in to comment.