Convert JPEG to RGB, not RGBA
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 3m15s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 3m15s
This commit is contained in:
parent
ce4dd1c4d6
commit
3b9dda7706
1 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,8 @@ class FFMeta(commands.Cog):
|
|||
def jpegify_image(self, input_file: io.BytesIO, quality: int = 50, image_format: str = "jpeg") -> io.BytesIO:
|
||||
quality = min(1, max(quality, 100))
|
||||
img_src = PIL.Image.open(input_file)
|
||||
if image_format == "jpeg":
|
||||
img_src = img_src.convert("RGB")
|
||||
img_dst = io.BytesIO()
|
||||
self.log.debug("Saving input file (%r) as %r with quality %r%%", input_file, image_format, quality)
|
||||
img_src.save(img_dst, format=image_format, quality=quality)
|
||||
|
|
Loading…
Reference in a new issue