have the bot convert tiff to jpg as well
This commit is contained in:
parent
008f6c2d1d
commit
37895da903
0
.gitignore
vendored
Executable file → Normal file
0
.gitignore
vendored
Executable file → Normal file
12
app/bot.py
12
app/bot.py
@ -81,13 +81,13 @@ async def convert_heic_to_jpg(ctx):
|
|||||||
|
|
||||||
if ctx.attachments:
|
if ctx.attachments:
|
||||||
for attachment in ctx.attachments:
|
for attachment in ctx.attachments:
|
||||||
if attachment.filename.lower().endswith("heic"):
|
if attachment.filename.lower().endswith(("heic", "tiff")):
|
||||||
heic_file = "/tmp/heic"
|
source_file = "/tmp/source"
|
||||||
jpg_file = "/tmp/jpg.jpg"
|
jpg_file = "/tmp/converted.jpg"
|
||||||
await attachment.save(fp=heic_file)
|
await attachment.save(fp=source_file)
|
||||||
|
|
||||||
# Convert heic to jpg
|
# Convert to jpg
|
||||||
img = Image(filename=heic_file)
|
img = Image(filename=source_file)
|
||||||
img.format = "jpg"
|
img.format = "jpg"
|
||||||
img.save(filename=jpg_file)
|
img.save(filename=jpg_file)
|
||||||
img.close()
|
img.close()
|
||||||
|
0
app/questions.py
Executable file → Normal file
0
app/questions.py
Executable file → Normal file
@ -8,7 +8,7 @@ image:
|
|||||||
repository: ldooks/dragon-bot
|
repository: ldooks/dragon-bot
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: "128"
|
tag: "130"
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user