summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-18 23:52:51 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-18 23:52:51 +0200
commitdc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360 (patch)
treea7d03238090be0ff751888de847aad1228409597 /g4f
parentAdd get/set cookies dir, hide prompt option in gui (diff)
downloadgpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar.gz
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar.bz2
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar.lz
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar.xz
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.tar.zst
gpt4free-dc77a1a7ffb54e9d98a7c74c32baf3c9ddb61360.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/gui/server/backend.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/gui/server/backend.py b/g4f/gui/server/backend.py
index d9e31c0e..b8da0221 100644
--- a/g4f/gui/server/backend.py
+++ b/g4f/gui/server/backend.py
@@ -1,6 +1,6 @@
import json
from flask import request, Flask
-from g4f.image import is_allowed_extension, to_image
+from g4f.image import is_allowed_extension, to_bytes
from .api import Api
class Backend_Api(Api):
@@ -79,7 +79,7 @@ class Backend_Api(Api):
if "file" in request.files:
file = request.files['file']
if file.filename != '' and is_allowed_extension(file.filename):
- kwargs['image'] = to_image(file.stream, file.filename.endswith('.svg'))
+ kwargs['image'] = to_bytes(file.stream)
kwargs['image_name'] = file.filename
if "json" in request.form:
json_data = json.loads(request.form['json'])