fix(media): ابعاد خروجی FFmpeg با Pillow خوانده شود — ffprobe روی WebP صفر برمیگرداند
This commit is contained in:
@@ -460,9 +460,11 @@ def _ffmpeg_webp(data: bytes) -> tuple[bytes, int | None, int | None]:
|
||||
run_convert(["-frames:v", "1"], still_vf)
|
||||
with open(dst, "rb") as fh:
|
||||
out = fh.read()
|
||||
dims = _ffprobe_video(dst)[0] or {}
|
||||
width = int(dims["width"]) if dims.get("width") else None
|
||||
height = int(dims["height"]) if dims.get("height") else None
|
||||
# ffprobe روی WebP عرض/ارتفاع صفر برمیگرداند — ابعاد از خود خروجی با Pillow
|
||||
try:
|
||||
width, height = Image.open(io.BytesIO(out)).size
|
||||
except Exception:
|
||||
width = height = None
|
||||
return out, width, height
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user