Skip to content

Commit

Permalink
⚡ feat: .JPEG 지원추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0219kms authored Apr 9, 2024
1 parent 929a2e6 commit 9281bf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/uploadService.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def upload(self, type: UploadType, message: Message) -> tuple[int, str]:
if filename.endswith(".jpg") or filename.endswith(".png"):
converted_image = Image.open(join("temp/", f"{message.author.id}_{filename}"))
converted_image.save(
join("temp/", f"{message.author.id}_{re.sub(r'\.(jpg|png)$', '.webp', filename)}"), "webp"
join("temp/", f"{message.author.id}_{re.sub(r'\.(jpg|jpeg|png)$', '.webp', filename)}"), "webp"
)
converted_image.close()

Expand All @@ -116,7 +116,7 @@ async def upload(self, type: UploadType, message: Message) -> tuple[int, str]:

uploadRes = self.nasStation.upload_file(
dest_path=upload_dest_path,
file_path=join("temp/", f"{message.author.id}_{re.sub(r'\.(jpg|png)$', '.webp', filename)}"),
file_path=join("temp/", f"{message.author.id}_{re.sub(r'\.(jpg|jpeg|png)$', '.webp', filename)}"),
overwrite=True,
)

Expand Down

0 comments on commit 9281bf1

Please sign in to comment.