nesau
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
import os
|
||||
import time
|
||||
from PIL import Image, ImageFont, ImageDraw
|
||||
import lorem
|
||||
|
||||
from font_game import base64, IMAGE_SIZE, IMAGE_BACKGROUND, MARGINS, FONT_COLOR
|
||||
from font_game import gen_id, IMAGE_SIZE, IMAGE_BACKGROUND, MARGINS, FONT_COLOR
|
||||
|
||||
def gen_image(font: ImageFont.ImageFont) -> str:
|
||||
img = Image.new("RGB", IMAGE_SIZE, IMAGE_BACKGROUND)
|
||||
@ -29,7 +28,7 @@ def gen_image(font: ImageFont.ImageFont) -> str:
|
||||
spacing=30
|
||||
)
|
||||
|
||||
filename = base64(int(time.time() * 10000) % 0xffffff)
|
||||
filename = gen_id()
|
||||
|
||||
path = f"static/images/{filename}.png"
|
||||
|
||||
|
Reference in New Issue
Block a user