summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-02-10 20:16:38 +0100
committerGitHub <noreply@github.com>2024-02-10 20:16:38 +0100
commit4ba52b3695469ba773bfce03c19fe3c8b442b8fd (patch)
tree14edc4dc6858aec0e9cc82ac8698f3c5768ef2e9 /g4f
parentMerge pull request #1573 from rafaelmfonseca/main (diff)
downloadgpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar.gz
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar.bz2
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar.lz
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar.xz
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.tar.zst
gpt4free-4ba52b3695469ba773bfce03c19fe3c8b442b8fd.zip
Diffstat (limited to '')
-rw-r--r--g4f/image.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/image.py b/g4f/image.py
index 29194d6e..31c3d577 100644
--- a/g4f/image.py
+++ b/g4f/image.py
@@ -163,10 +163,10 @@ def process_image(img: Image, new_width: int, new_height: int) -> Image:
# Resize image
img.thumbnail((new_width, new_height))
# Remove transparency
- if img.mode != "RGB":
+ if img.mode == "RGBA":
img.load()
white = new_image('RGB', img.size, (255, 255, 255))
- white.paste(img, mask=img.convert('RGBA').split()[-1])
+ white.paste(img, mask=img.split()[-1])
return white
return img