Skip to content

Commit

Permalink
fix: 修复封面裁剪错误
Browse files Browse the repository at this point in the history
  • Loading branch information
cnzgray committed Nov 8, 2024
1 parent 13fa5ae commit ff5179b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javsp/cropper/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def crop_specific(self, fanart: Image, ratio: float) -> Image:
if fanart_h / fanart_w < ratio \
else (fanart_w, int(fanart_w * ratio)) # 图片太“瘦”时以宽度来定裁剪高度

box = (poster_w - fanart_w, 0, poster_w, poster_h)
fanart.crop(box)
return fanart
# (left, upper, right, lower)
box = (fanart_w - poster_w, 0, fanart_w, poster_h)
poster = fanart.crop(box)
return poster

0 comments on commit ff5179b

Please sign in to comment.