change image library and refactor thumbnails service

This commit is contained in:
David Christofas
2020-11-26 16:36:51 +01:00
parent c5a75291f9
commit c46a5598d4
18 changed files with 355 additions and 321 deletions
@@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
@@ -70,7 +71,7 @@ func (s *FileSystem) Set(username string, key string, img []byte) error {
func (s *FileSystem) BuildKey(r Request) string {
etag := r.ETag
filetype := r.Types[0]
filename := r.Resolution.String() + "." + filetype
filename := strconv.Itoa(r.Resolution.Dx()) + "x" + strconv.Itoa(r.Resolution.Dy()) + "." + filetype
return filepath.Join(etag[:2], etag[2:4], etag[4:], filename)
}