Skip to content

Commit

Permalink
fix compress
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsmh committed Jan 4, 2025
1 parent 23437cb commit d113220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions biliparser/strategy/video.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
from math import log
import os
import re
from functools import cached_property
from urllib.parse import parse_qs, urlparse

import orjson
from bilibili_api import video
from telegram.constants import FileSizeLimit

from ..cache import CACHES_TIMER, RedisCache
from ..utils import (
BILI_API,
LOCAL_MODE,
ParserException,
credential,
escape_markdown,
get_filename,
headers,
logger,
credential,
)
from .feed import Feed
from bilibili_api import video
from urllib.parse import urlparse, parse_qs

QN = [64, 32, 16]

Expand Down
1 change: 1 addition & 0 deletions biliparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def compress(inpil, size=1280, fix_ratio=False) -> BytesIO:
new_w = math.ceil(h / 20)
padded = Image.new("RGBA", (new_w, h))
padded.paste(pil, (int((new_w - h) / 2), 0))
pil = padded
if size > 0:
pil.thumbnail((size, size), Image.Resampling.LANCZOS)
outpil = BytesIO()
Expand Down

0 comments on commit d113220

Please sign in to comment.