mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-12-02 01:48:10 +09:00
fix cannot write mode RGBA as JPEG
This commit is contained in:
1 parent
9d00ed2f93
commit
fe95438da9
2 files changed
+35
-3
No files matched your search
@@ -63,6 +63,7 @@ def download_and_convert_thumbnail(ydl_opts, url: str, clear_filename: str, outp
|
||||
response = ydl.urlopen(thumbnail_url)
|
||||
image_data = response.read()
|
||||
image = Image.open(io.BytesIO(image_data))
|
||||
image = image.convert('RGB') # Convert to RGB to avoid transparency or RGBA issues
|
||||
image_path = os.path.join(output_path, clear_filename + " [CO].jpg")
|
||||
image.save(image_path, "JPEG")
|
||||
crop_image_to_square(image_path)
|
||||
|
||||
Reference in new issue
Block a user