将不是三通道的图像转换为三通道
This commit is contained in:
2
pp.py
2
pp.py
@@ -42,7 +42,7 @@ def download_image(url: str) -> Image.Image:
|
|||||||
else:
|
else:
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
img = Image.open(io.BytesIO(response.content))
|
img = Image.open(io.BytesIO(response.content))
|
||||||
if img.mode != 'RGB'
|
if img.mode != 'RGB':
|
||||||
img = img.convert('RGB')
|
img = img.convert('RGB')
|
||||||
return img
|
return img
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Reference in New Issue
Block a user