Update app.py
Browse files
app.py
CHANGED
|
@@ -57,7 +57,8 @@ def start_image_search(image, text):
|
|
| 57 |
## Alert the user to upload an image
|
| 58 |
raise gr.Error("Please upload an image first, make sure to press the 'Submit' button after selecting the image.")
|
| 59 |
buffered = io.BytesIO()
|
| 60 |
-
image.
|
|
|
|
| 61 |
img_byte = buffered.getvalue()
|
| 62 |
# Encode this byte array to Base64
|
| 63 |
img_base64 = base64.b64encode(img_byte)
|
|
|
|
| 57 |
## Alert the user to upload an image
|
| 58 |
raise gr.Error("Please upload an image first, make sure to press the 'Submit' button after selecting the image.")
|
| 59 |
buffered = io.BytesIO()
|
| 60 |
+
image = image.resize((800, 600))
|
| 61 |
+
image.save(buffered, format="JPEG", quality=85)
|
| 62 |
img_byte = buffered.getvalue()
|
| 63 |
# Encode this byte array to Base64
|
| 64 |
img_base64 = base64.b64encode(img_byte)
|