mirror of https://github.com/spikecodes/libreddit
Use the correct size for the new image code paths. Remove lazy loading of post images.
This commit is contained in:
parent
96f4cb97fa
commit
b06c7241c8
|
@ -69,7 +69,7 @@
|
|||
<!-- post_type: {{ post.post_type }} -->
|
||||
{% if post.post_type == "image" %}
|
||||
<a href="{{ post.media.url }}" class="post_media_image" >
|
||||
<img loading="lazy" alt="Post image" src="{{ post.media.url }}"/>
|
||||
<img alt="Post image" src="{{ post.media.url }}"/>
|
||||
</a>
|
||||
{% else if post.post_type == "video" || post.post_type == "gif" %}
|
||||
{% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
|
||||
|
|
|
@ -100,10 +100,10 @@
|
|||
<!-- This causes two problems: right-clicking images will have a very degraded menu: no "copy image (link)", and bad display of reddit-hosted previews. -->
|
||||
<a href="{{ post.media.url }}" class="post_media_image {% if post.media.height < post.media.width*2 %}short{% endif %}" >
|
||||
{% if post.media.height == 0 || post.media.width == 0 %}
|
||||
<!-- debug: reddit-hosted: svg workaround image thumbnail -->
|
||||
<!-- debug: reddit-hosted: svg workaround image thumbnail with unknown dimensions. -->
|
||||
<svg
|
||||
width="{{ post.media.width }}px"
|
||||
height="{{ post.media.height }}px"
|
||||
width="100%"
|
||||
height="100%"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<image width="100%" height="100%" href="{{ post.media.url }}"/>
|
||||
<desc>
|
||||
|
@ -111,8 +111,8 @@
|
|||
</desc>
|
||||
</svg>
|
||||
{% else %}
|
||||
<!-- debug: simplified image thumbnail -->
|
||||
<img loading="lazy" alt="Post image" src="{{ post.media.url }}"/>
|
||||
<!-- debug: simplified image thumbnail with known dimensions. -->
|
||||
<img loading="lazy" width="{{ post.media.width }}px" height="{{ post.media.height }}px" alt="Post image" src="{{ post.media.url }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% else if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "gif" %}
|
||||
|
|
Loading…
Reference in New Issue