返回提交历史
Modified
g4f/image/__init__.py
+2
-0
XFEstudio/gpt4free
Update check valid images
27507318
代码差异
1 个文件
+2
-0
@@ -116,6 +116,8 @@ def is_valid_media(data: ImageType = None, filename: str = None) -> str:
116
116
media_type = EXTENSIONS_MAP[extension]
117
117
if media_type.startswith("image/"):
118
118
return media_type
119
if not data:
120
return False
119
121
if isinstance(data, bytes):
120
122
return is_accepted_format(data)
121
123
return is_data_uri_an_image(data)