XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update check valid images

27507318
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -0
Modified g4f/image/__init__.py +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)