diff --git a/backend/app/api/admin.py b/backend/app/api/admin.py index 06dbef5..a5a0b75 100644 --- a/backend/app/api/admin.py +++ b/backend/app/api/admin.py @@ -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