Skip to content

Commit

Permalink
prioritize higher res images
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbzm committed Aug 27, 2024
1 parent f2b8823 commit 1179b09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions data_extraction/build_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ def load_methods_summaries(ranks, groupcolors):
summary = file_content.split('\n', 1)[1].strip()

#get image path, webp, png or jpg
if os.path.exists(f"project-page/static/images/{file.split('.')[0]}_small.webp"):
image = f"static/images/{file.split('.')[0]}_small.webp"
elif os.path.exists(f"project-page/static/images/{file.split('.')[0]}_medium.webp"):
if os.path.exists(f"project-page/static/images/{file.split('.')[0]}_medium.webp"):
image = f"static/images/{file.split('.')[0]}_medium.webp"
elif os.path.exists(f"project-page/static/images/{file.split('.')[0]}_small.webp"):
image = f"static/images/{file.split('.')[0]}_small.webp"
elif os.path.exists(f"project-page/static/images/{file.split('.')[0]}.webp"):
image = f"static/images/{file.split('.')[0]}.webp"
elif os.path.exists(f"project-page/static/images/{file.split('.')[0]}.png"):
Expand Down
6 changes: 5 additions & 1 deletion project-page/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,11 @@ <h2 class="title is-3" style="margin-left: 10px; margin-right: 10px;">
{{ paper.summary }}
</p>
<div style="display: flex; justify-content: center; align-items: center">
<img src="{{ paper.image }}" alt="" width="{{paper.imwidth}}" height="{{paper.imheight}}" style="max-height: 250px;" loading="lazy">
{% if paper.imheight <= 250 %}
<img src="{{ paper.image }}" alt="" width="{{paper.imwidth}}" height="{{paper.imheight}}" loading="lazy">
{% else %}
<img src="{{ paper.image }}" alt="" style="max-height: 250px;" loading="lazy">
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit 1179b09

Please sign in to comment.