Skip to content

Commit

Permalink
bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogapod committed Oct 19, 2024
1 parent 1122584 commit 772cfcb
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 262 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -19,7 +19,7 @@ repos:
^.*.md$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.7.0
hooks:
- id: ruff-format
- id: ruff
Expand Down
4 changes: 2 additions & 2 deletions src/cogs/images/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ def _draw_trocr(src: PilImage.Image, fields: Sequence[TextField]) -> BytesIO:
for field in fields:
# TODO: figure out how to fit text into boxes with Pillow without creating
# extra images
font = FONT.font_variant(size=field.font_size) # type: ignore[no-untyped-call]
font = FONT.font_variant(size=field.font_size)

left, top, right, bottom = font.getbbox(field.text, stroke_width=field.stroke_width)
text_im = PilImage.new("RGBA", size=(right - left, bottom - top))
text_im = PilImage.new("RGBA", size=(int(right - left), int(bottom - top)))

ImageDraw.Draw(text_im).text(
(0, 0),
Expand Down
Loading

0 comments on commit 772cfcb

Please sign in to comment.