Skip to content

Commit

Permalink
fix: image crop
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxsen committed Jul 6, 2024
1 parent 43c85ef commit 47622fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func CutCensoredImage(img image.Image) (image.Image, error) {
if img.Bounds().Dx() > img.Bounds().Dy() { //横屏
middle := img.Bounds().Dx() //直接取最大值, 由底层函数自行扩展即可
return cutHorizontalImage(img, middle, defaultAspectRatio)
} else if img.Bounds().Dx() > img.Bounds().Dy() {
} else if img.Bounds().Dx() < img.Bounds().Dy() {
//正常不应该出现骑兵封面为竖屏的
//另一方面, 正常人像应该是上面, 所以从上开始截取
return cutVerticalImage(img, 0, defaultAspectRatio)
Expand Down

0 comments on commit 47622fb

Please sign in to comment.