Skip to content

Commit

Permalink
AttributeError: 'ImageDraw' object has no attribute 'textsize'
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhhu authored Aug 16, 2023
1 parent e7c403b commit a0f8cbd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/memify.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


@ultroid_cmd(pattern="mmf ?(.*)")
async def ultd(event):
async def mmf_func(event):
ureply = await event.get_reply_message()
msg = event.pattern_match.group(1)
if not (ureply and (ureply.media)):
Expand Down Expand Up @@ -105,7 +105,7 @@ async def draw_meme_text(image_path, msg):
current_h, pad = 10, 5
if upper_text:
for u_text in textwrap.wrap(upper_text, width=15):
u_width, u_height = draw.textsize(u_text, font=m_font)
u_width, u_height = draw.textlength(u_text, font=m_font)
draw.text(
xy=(((i_width - u_width) / 2) - 1,
int((current_h / 640) * i_width)),
Expand Down Expand Up @@ -143,7 +143,7 @@ async def draw_meme_text(image_path, msg):
current_h += u_height + pad
if lower_text:
for l_text in textwrap.wrap(lower_text, width=15):
u_width, u_height = draw.textsize(l_text, font=m_font)
u_width, u_height = draw.textlength(l_text, font=m_font)
draw.text(
xy=(
((i_width - u_width) / 2) - 1,
Expand Down Expand Up @@ -271,7 +271,7 @@ async def draw_meme(image_path, msg):
current_h, pad = 10, 5
if upper_text:
for u_text in textwrap.wrap(upper_text, width=15):
u_width, u_height = draw.textsize(u_text, font=m_font)
u_width, u_height = draw.textlength(u_text, font=m_font)
draw.text(
xy=(((i_width - u_width) / 2) - 1,
int((current_h / 640) * i_width)),
Expand Down Expand Up @@ -309,7 +309,7 @@ async def draw_meme(image_path, msg):
current_h += u_height + pad
if lower_text:
for l_text in textwrap.wrap(lower_text, width=15):
u_width, u_height = draw.textsize(l_text, font=m_font)
u_width, u_height = draw.textlength(l_text, font=m_font)
draw.text(
xy=(
((i_width - u_width) / 2) - 1,
Expand Down

0 comments on commit a0f8cbd

Please sign in to comment.