diff options
-rw-r--r-- | wqflask/utility/pillow_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/wqflask/utility/pillow_utils.py b/wqflask/utility/pillow_utils.py index dfbf3e19..0c2ce7af 100644 --- a/wqflask/utility/pillow_utils.py +++ b/wqflask/utility/pillow_utils.py @@ -1,5 +1,7 @@ from PIL import Image, ImageColor, ImageDraw, ImageFont +from utility.tools import TEMPDIR + import utility.logger logger = utility.logger.getLogger(__name__ ) @@ -14,7 +16,7 @@ def draw_rotated_text(canvas, text, font, xy, fill=BLACK, angle=-90): 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("/tmp/{}.png".format(text), format="png") + 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): |