Save small avatars in a different directory
This commit is contained in:
parent
5d97a87152
commit
4145f86e84
@ -46,6 +46,6 @@ func avatarToWebP(in string, out string, quality float32) error {
|
|||||||
|
|
||||||
// Small avatar
|
// Small avatar
|
||||||
smallImg := resize.Resize(arn.AvatarSmallSize, 0, img, resize.Lanczos3)
|
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
|
return saveErr
|
||||||
}
|
}
|
||||||
|
2
main.go
2
main.go
@ -106,7 +106,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ctx.CanUseWebP() {
|
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")
|
err = errors.New("Your browser doesn't support the WebP image format")
|
||||||
|
Loading…
Reference in New Issue
Block a user