1
0

feat: generate a BlurHash when uploading a new image

This commit is contained in:
kolaente
2021-12-12 21:42:35 +01:00
committed by Gitea
parent 362706b38d
commit f83b09af59
5 changed files with 47 additions and 17 deletions

View File

@ -18,6 +18,7 @@ package migration
import (
"bytes"
"code.vikunja.io/api/pkg/modules/background/handler"
"io/ioutil"
"xorm.io/xorm"
@ -115,7 +116,12 @@ func insertFromStructure(s *xorm.Session, str []*models.NamespaceWithListsAndTas
return err
}
err = models.SetListBackground(s, l.ID, file)
hash, err := handler.CreateBlurHash(backgroundFile)
if err != nil {
return err
}
err = models.SetListBackground(s, l.ID, file, hash)
if err != nil {
return err
}