Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Jul 18, 2023
1 parent bc29326 commit e96690d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion list.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"list": [
{
"name": "sticker_refactor",
"version": "1.08",
"version": "1.09",
"section": "chat",
"maintainer": "Guimc",
"size": "9.22kb",
Expand Down
7 changes: 5 additions & 2 deletions sticker_refactor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

SUPPORTED_IMAGE_FILE = (".png", ".jpg", ".jpeg", ".bmp", ".cur", ".dcx", ".fli",
".flc", ".fpx", ".gbr", ".gd", ".ico", ".im", ".imt", ".psd")
IMAGE_IMPROVE = Image.LANCZOS


class GeneralError(Exception):
Expand All @@ -46,7 +47,9 @@ def set_emoji(e: str) -> None:


def is_emoji(content: str) -> bool:
if content and (u"\U0001F600" <= content <= u"\U0001F64F" or u"\U0001F300" <= content <= u"\U0001F5FF" or u"\U0001F680" <= content <= u"\U0001F6FF" or u"\U0001F1E0" <= content <= u"\U0001F1FF" or content in ["⭐️", "❌"]):
if content and (u"\U0001F600" <= content <= u"\U0001F64F" or u"\U0001F300" <= content <= u"\U0001F5FF" or
u"\U0001F680" <= content <= u"\U0001F6FF" or u"\U0001F1E0" <= content <= u"\U0001F1FF" or
emoji.is_emoji(content) or content in ["⭐️", "❌"]):
return True
else:
return False
Expand Down Expand Up @@ -160,7 +163,7 @@ def convert_image(imgfile: str) -> str:
else:
scaling = 512 / height

img = img.resize((int(width * scaling), int(height * scaling)))
img = img.resize((int(width * scaling), int(height * scaling)), IMAGE_IMPROVE)
img.save(imgfile + "_patched.png")

return imgfile + "_patched.png"
Expand Down

0 comments on commit e96690d

Please sign in to comment.