Skip to content

Commit

Permalink
add 🐔 (#64)
Browse files Browse the repository at this point in the history
* add 这是鸡

* 🚨 auto fix by pre-commit hooks

* change 画质

* add 自定义文字,高清大图的🐔

* add 高清大图的🐔,跟自定义文字

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
balh55y and pre-commit-ci[bot] committed Nov 12, 2023
1 parent 8d24f74 commit 293bcac
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions meme_generator/memes/this_chicken/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from pathlib import Path
from typing import List

from pil_utils import BuildImage

from meme_generator import add_meme
from meme_generator.exception import TextOverLength

img_dir = Path(__file__).parent / "images"


def this_chichen(images: List[BuildImage], texts, args):
text = texts[0] if texts else "这是十二生肖中的鸡"
img = images[0].convert("RGBA").resize((640, 640), keep_ratio=True)

frame = BuildImage.open(img_dir / "0.png")
try:
frame.draw_text(
(439, 956, 1001, 1038),
text,
max_fontsize=60,
min_fontsize=30,
fill="white",
)
except ValueError:
raise TextOverLength(text)
frame.paste(
img.perspective(((507, 0), (940, 351), (383, 625), (0, 256))),
(201, 201),
below=True,
)
return frame.save_jpg()


add_meme(
"this_chichen",
this_chichen,
min_images=1,
max_images=1,
max_texts=1,
default_texts="这是十二生肖中的鸡",
keywords=["这是鸡", "🐔"],
)
Binary file added meme_generator/memes/this_chicken/images/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 293bcac

Please sign in to comment.