Save small avatars in a different directory

This commit is contained in:
Eduard Urbach 2017-06-13 01:14:52 +02:00
parent 5d97a87152
commit 4145f86e84
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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")