mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-06-02 10:34:54 +12:00
flip input quality for jpeg
This commit is contained in:
parent
df579194c2
commit
f77673b6eb
|
@ -105,7 +105,7 @@ class ImageMagic(commands.Cog):
|
||||||
|
|
||||||
# compress
|
# compress
|
||||||
temp_file = BytesIO()
|
temp_file = BytesIO()
|
||||||
img.save(temp_file, "JPEG", quality=quality)
|
img.save(temp_file, "JPEG", quality=(1 - quality))
|
||||||
temp_file.seek(0)
|
temp_file.seek(0)
|
||||||
|
|
||||||
# return as wand image
|
# return as wand image
|
||||||
|
@ -156,11 +156,12 @@ class ImageMagic(commands.Cog):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@distort.command()
|
@distort.command()
|
||||||
async def jpeg(self, ctx, quality: Optional[float] = 10, *, link: str = None):
|
async def jpeg(self, ctx, intensity: Optional[float] = 10, *, link: str = None):
|
||||||
"""
|
"""
|
||||||
Applies JPEG compression to image
|
Applies JPEG compression to image
|
||||||
"""
|
"""
|
||||||
quality = int(self._intensity(quality) * 100)
|
# we want to flip the quality range so it matches the intentsity of other commands.
|
||||||
|
quality = int(self._intensity(intensity) * 100)
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
try:
|
try:
|
||||||
img = await self._get_image(ctx, link)
|
img = await self._get_image(ctx, link)
|
||||||
|
|
Loading…
Reference in a new issue