From 02eb014dd82a0e17eb8749980418f12eb5564b90 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 10 Dec 2022 21:39:30 +0200 Subject: [PATCH] posters for videos --- files/routes/posts.py | 4 ++-- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index bff42facc1..a31dbf4035 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -747,8 +747,8 @@ def submit_post(v:User, sub=None): post.url = process_video(file, v) name = f'/images/{time.time()}'.replace('.','') + '.webp' subprocess.run(['ffmpeg', '-y', '-loglevel', 'warning', - '-i', post.url, '-vf', '"select=eq(n\,0)"', '-vf', - 'scale=100:-2', '-q:v', '3', '-frames:v', '1', name], check=True) + '-i', post.url, '-vf', "scale='min(300,iw)':-2", + '-q:v', '3', '-frames:v', '1', name], check=True) post.thumburl = name elif file.content_type.startswith('audio/'): post.url = process_audio(file, v) diff --git a/files/templates/submission.html b/files/templates/submission.html index 2abe0eea51..a0ca0fd163 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -143,7 +143,7 @@

- +

diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 229468aecd..4766e1302a 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -248,7 +248,7 @@ {% elif p.is_video %}

- +

{% elif p.is_audio %}