Skip to content

Commit

Permalink
Fix upload image
Browse files Browse the repository at this point in the history
  • Loading branch information
hlohaus committed May 18, 2024
1 parent 9ddac17 commit dc77a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions g4f/gui/server/backend.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -79,7 +79,7 @@ def handle_conversation(self):
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'])
Expand Down

0 comments on commit dc77a1a

Please sign in to comment.