Save small avatars in a different directory
This commit is contained in:
@ -46,6 +46,6 @@ func avatarToWebP(in string, out string, quality float32) error {
|
||||
|
||||
// Small avatar
|
||||
smallImg := resize.Resize(arn.AvatarSmallSize, 0, img, resize.Lanczos3)
|
||||
saveErr = arn.SaveWebP(smallImg, strings.Replace(out, ".webp", ".small.webp", 1), quality)
|
||||
saveErr = arn.SaveWebP(smallImg, strings.Replace(out, "webp/", "webp-small/", 1), quality)
|
||||
return saveErr
|
||||
}
|
||||
|
2
main.go
2
main.go
@ -106,7 +106,7 @@ func main() {
|
||||
}
|
||||
|
||||
if ctx.CanUseWebP() {
|
||||
return ctx.File("images/avatars/webp/" + user.ID + ".small.webp")
|
||||
return ctx.File("images/avatars/webp-small/" + user.ID + ".webp")
|
||||
}
|
||||
|
||||
err = errors.New("Your browser doesn't support the WebP image format")
|
||||
|
Reference in New Issue
Block a user