ZHIWEI666 commited on
Commit
b683813
·
verified ·
1 Parent(s): 4bd2c56

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -335,7 +335,11 @@ def upload_file(file: UploadFile = File(...), file_type: str = Form(...), curren
335
  if file_type == "avatar":
336
  max_size = 2 * 1024 * 1024
337
  elif file_type == "cover":
338
- max_size = 5 * 1024 * 1024
 
 
 
 
339
  elif file_type == "post_video":
340
  max_size = 100 * 1024 * 1024
341
 
 
335
  if file_type == "avatar":
336
  max_size = 2 * 1024 * 1024
337
  elif file_type == "cover":
338
+ # GIF 动图允许更大文件(前端不压缩,保留动画)
339
+ if file.filename and file.filename.lower().endswith('.gif'):
340
+ max_size = 50 * 1024 * 1024 # GIF: 50MB
341
+ else:
342
+ max_size = 5 * 1024 * 1024 # 其他图片: 5MB
343
  elif file_type == "post_video":
344
  max_size = 100 * 1024 * 1024
345