mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Use webp for thumbnails when available
This commit is contained in:
parent
88c6135030
commit
cd163b26a3
3 changed files with 13 additions and 14 deletions
|
|
@ -7,14 +7,7 @@ import renderutils
|
|||
import ".."/[types, utils, formatters]
|
||||
import general
|
||||
|
||||
const
|
||||
doctype = "<!DOCTYPE html>\n"
|
||||
|
||||
proc getSmallPic(url: string): string =
|
||||
result = url
|
||||
if "?" notin url and not url.endsWith("placeholder.png"):
|
||||
result &= "?name=small"
|
||||
result = getPicUrl(result)
|
||||
const doctype = "<!DOCTYPE html>\n"
|
||||
|
||||
proc renderMiniAvatar(user: User; prefs: Prefs): VNode =
|
||||
let url = getPicUrl(user.getUserPic("_mini"))
|
||||
|
|
@ -60,9 +53,8 @@ proc renderAlbum(tweet: Tweet): VNode =
|
|||
tdiv(class="attachment image"):
|
||||
let
|
||||
named = "name=" in photo
|
||||
orig = photo
|
||||
small = if named: photo else: photo & "?name=small"
|
||||
a(href=getOrigPicUrl(orig), class="still-image", target="_blank"):
|
||||
small = if named: photo else: photo & smallWebp
|
||||
a(href=getOrigPicUrl(photo), class="still-image", target="_blank"):
|
||||
genImg(small)
|
||||
|
||||
proc isPlaybackEnabled(prefs: Prefs; playbackType: VideoType): bool =
|
||||
|
|
|
|||
Loading…
Reference in a new issue