fix AttributeError (#11556)

pull/11682/head
Wang Xin 2024-03-06 13:02:42 +08:00 committed by GitHub
parent 52cf1e1bdd
commit 14fff65868
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ class StdTextDrawer(object):
i = 0
while i < len(corpus):
char_i = corpus[i]
char_size = font.getsize(char_i)[0]
char_size = font.getbbox(char_i)[2]
# split when char_x exceeds char size and index is not 0 (at least 1 char should be wroten on the image)
if char_x + char_size >= width and i != 0:
text_input = np.array(bg).astype(np.uint8)