fixed rotating vertical images

This commit is contained in:
bvn13 2025-04-12 20:28:33 +03:00
parent ba1d12b206
commit 891e323094
5 changed files with 4 additions and 0 deletions

2
.gitignore vendored Normal file

@ -0,0 +1,2 @@
**/__pycache__/**
*.pyc

Binary file not shown.

@ -1,6 +1,7 @@
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageOps
def watermark_text(input_image_path: str,
@ -20,6 +21,7 @@ def watermark_text(input_image_path: str,
yellow = (237,255,33)
font = ImageFont.truetype(font_path, size, encoding='unic')
drawing.text(pos, text=text, fill=yellow, font=font, anchor="la")
photo = ImageOps.exif_transpose(photo)
if show:
photo.show()
photo.save(output_image_path)

BIN
samples/IMG_0986.jpg Normal file

Binary file not shown.

After

(image error) Size: 4.0 MiB

BIN
samples/IMG_0986_wm.jpg Normal file

Binary file not shown.

After

(image error) Size: 836 KiB