refactor(images): Move sponsor images to folder and load them dynamicly
This commit is contained in:
@@ -82,12 +82,11 @@ func (t *DefaultTemplater) GenerateBarcode(code string, format string, prefix st
|
||||
}
|
||||
|
||||
func (t *DefaultTemplater) SelectSponsorImage(id int) (string, error) {
|
||||
sponsors := []string{
|
||||
"vrbank",
|
||||
"odit",
|
||||
"sparkasse",
|
||||
sponsors, err := ListFilesInStaticSubFolder("images/sponsors")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return GetImage(sponsors[id%len(sponsors)]), nil
|
||||
return GetImage("sponsors/" + strings.TrimSuffix(sponsors[id%len(sponsors)], ".base64")), nil
|
||||
}
|
||||
|
||||
func (t *DefaultTemplater) LoadImage(name string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user