summaryrefslogtreecommitdiffstats
path: root/g4f/image.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-09 03:31:05 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-09 03:31:05 +0100
commit47900f23718e398fc086a6dfbf6590b4c5859c28 (patch)
tree0469ae9e03628c2e1a1aadfe456169e85bceaea0 /g4f/image.py
parentAdd Gemini Provider with image upload and generation (diff)
downloadgpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar.gz
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar.bz2
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar.lz
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar.xz
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.tar.zst
gpt4free-47900f23718e398fc086a6dfbf6590b4c5859c28.zip
Diffstat (limited to '')
-rw-r--r--g4f/image.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/g4f/image.py b/g4f/image.py
index 3f26f75f..f0ee0395 100644
--- a/g4f/image.py
+++ b/g4f/image.py
@@ -46,9 +46,8 @@ def to_image(image: ImageType, is_svg: bool = False) -> Image:
return open_image(BytesIO(image))
elif not isinstance(image, Image):
image = open_image(image)
- copy = image.copy()
- copy.format = image.format
- return copy
+ image.load()
+ return image
return image
def is_allowed_extension(filename: str) -> bool: