From 204a308be0f741726b9a620d88fbc22b22124c81 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 18:55:37 +0000 Subject: Namespace all modules under gn2. We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service. --- wqflask/utility/pillow_utils.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 wqflask/utility/pillow_utils.py (limited to 'wqflask/utility/pillow_utils.py') diff --git a/wqflask/utility/pillow_utils.py b/wqflask/utility/pillow_utils.py deleted file mode 100644 index e302df18..00000000 --- a/wqflask/utility/pillow_utils.py +++ /dev/null @@ -1,28 +0,0 @@ -from PIL import Image, ImageColor, ImageDraw, ImageFont - -from utility.tools import TEMPDIR - -BLACK = ImageColor.getrgb("black") -WHITE = ImageColor.getrgb("white") - -# def draw_rotated_text(canvas: Image, text: str, font: ImageFont, xy: tuple, fill: ImageColor=BLACK, angle: int=-90): - - -def draw_rotated_text(canvas, text, font, xy, fill=BLACK, angle=-90): - # type: (Image, str, ImageFont, tuple, ImageColor, int) - """Utility function draw rotated text""" - tmp_img = Image.new("RGBA", font.getsize(text), color=(0, 0, 0, 0)) - draw_text = ImageDraw.Draw(tmp_img) - draw_text.text(text=text, xy=(0, 0), font=font, fill=fill) - tmp_img2 = tmp_img.rotate(angle, expand=1) - tmp_img2.save("/{0}/{1}.png".format(TEMPDIR, text), format="png") - canvas.paste(im=tmp_img2, box=tuple([int(i) for i in xy])) - -# def draw_open_polygon(canvas: Image, xy: tuple, fill: ImageColor=WHITE, outline: ImageColor=BLACK): - - -def draw_open_polygon(canvas, xy, fill=None, outline=BLACK, width=0): - # type: (Image, tuple, ImageColor, ImageColor) - draw_ctx = ImageDraw.Draw(canvas) - draw_ctx.polygon(xy, fill=fill) - draw_ctx.line(xy, fill=outline, width=width) -- cgit v1.2.3