Align photo watermark caption to the right
This commit is contained in:
@@ -57,11 +57,11 @@ def render_captioned_photo(
|
|||||||
while draw.textlength(text, font=font) > available and len(text) > 2:
|
while draw.textlength(text, font=font) > available and len(text) > 2:
|
||||||
text = text.rstrip("…")[:-1] + "…"
|
text = text.rstrip("…")[:-1] + "…"
|
||||||
draw.text(
|
draw.text(
|
||||||
(layout.margin, photo_height + layout.footer_height / 2),
|
(width - layout.margin, photo_height + layout.footer_height / 2),
|
||||||
text,
|
text,
|
||||||
font=font,
|
font=font,
|
||||||
fill="black",
|
fill="black",
|
||||||
anchor="lm",
|
anchor="rm",
|
||||||
)
|
)
|
||||||
out = BytesIO()
|
out = BytesIO()
|
||||||
canvas.save(out, "JPEG", quality=93, optimize=True)
|
canvas.save(out, "JPEG", quality=93, optimize=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user