Skip to content

Commit

Permalink
Merge pull request #99 from floyd-li/chore/depends
Browse files Browse the repository at this point in the history
  • Loading branch information
leslievan authored Jun 14, 2024
2 parents 6fe2e37 + f294441 commit 9a1173a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pillow==9.3.0
pyyaml==6.0
pillow==10.3.0
pyyaml==6.0.1
tqdm~=4.64.1
python-dateutil~=2.8.2
requests~=2.31.0
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def resize_image_with_height(image, height, auto_close=True):
new_width = round(width * scale)

# 进行等比缩放
resized_image = image.resize((new_width, height), Image.ANTIALIAS)
resized_image = image.resize((new_width, height), Image.LANCZOS)

# 关闭图片对象
if auto_close:
Expand All @@ -247,7 +247,7 @@ def resize_image_with_width(image, width, auto_close=True):
new_height = round(height * scale)

# 进行等比缩放
resized_image = image.resize((width, new_height), Image.ANTIALIAS)
resized_image = image.resize((width, new_height), Image.LANCZOS)

# 关闭图片对象
if auto_close:
Expand Down Expand Up @@ -302,7 +302,7 @@ def text_to_image(content, font, bold_font, is_bold=False, fill='black') -> Imag
font = bold_font
if content == '':
content = ' '
text_width, text_height = font.getsize(content)
_, _, text_width, text_height = font.getbbox(content)
image = Image.new('RGBA', (text_width, text_height), color=TRANSPARENT)
draw = ImageDraw.Draw(image)
draw.text((0, 0), content, fill=fill, font=font)
Expand Down

0 comments on commit 9a1173a

Please sign in to comment.