From 4145f86e8485f1a9a967c29728623b31fe1fb094 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 13 Jun 2017 01:14:52 +0200 Subject: [PATCH] Save small avatars in a different directory --- jobs/avatars/webp.go | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs/avatars/webp.go b/jobs/avatars/webp.go index 090f0a05..3a08edd9 100644 --- a/jobs/avatars/webp.go +++ b/jobs/avatars/webp.go @@ -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 } diff --git a/main.go b/main.go index f3f0bb27..2092dd58 100644 --- a/main.go +++ b/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")