Skip to content

Commit

Permalink
feat: add meme konata_watch (#147)
Browse files Browse the repository at this point in the history
* Create __init__.py

* Update tags.py

* Create 0

* Add files via upload

* Delete meme_generator/memes/izumi_watch/images/0

* style: auto fix by pre-commit hooks

* Update __init__.py

* Update __init__.py

* rename izumi to konata

* replace image

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: meetwq <meetwq@gmail.com>
  • Loading branch information
3 people authored Aug 19, 2024
1 parent 17e8d39 commit ab014cc
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions meme_generator/memes/konata_watch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from datetime import datetime
from pathlib import Path

from pil_utils import BuildImage

from meme_generator import add_meme
from meme_generator.tags import MemeTags
from meme_generator.utils import make_png_or_gif

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


def konata_watch(images: list[BuildImage], texts: list[str], args):
frame = BuildImage.open(img_dir / "0.png")

def make(imgs: list[BuildImage]) -> BuildImage:
img = imgs[0].convert("RGBA").resize((270, 200), keep_ratio=True)
return frame.copy().paste(
img.perspective(((0, 1), (275, 0), (273, 202), (2, 216))),
(50, 188),
below=True,
)

return make_png_or_gif(images, make)


add_meme(
"konata_watch",
konata_watch,
min_images=1,
max_images=1,
keywords=["泉此方看"],
tags=MemeTags.konata,
date_created=datetime(2024, 8, 18),
date_modified=datetime(2024, 8, 19),
)
Binary file added meme_generator/memes/konata_watch/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.
5 changes: 5 additions & 0 deletions meme_generator/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class MemeTags:

mahiro = {"绪山真寻"} | onimai

# 幸运星
lucky_star = {"幸运星"}

konata = {"泉此方"} | lucky_star

# 猫和老鼠
tom_and_jerry = {"猫和老鼠"}

Expand Down

0 comments on commit ab014cc

Please sign in to comment.