diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-02-10 20:16:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 20:16:38 +0100 |
commit | 4ba52b3695469ba773bfce03c19fe3c8b442b8fd (patch) | |
tree | 14edc4dc6858aec0e9cc82ac8698f3c5768ef2e9 | |
parent | Merge pull request #1573 from rafaelmfonseca/main (diff) | |
download | gpt4free-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 |
-rw-r--r-- | g4f/image.py | 4 |
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 |