mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40:50 +00:00
Make markdown as an independent module
This commit is contained in:
parent
d8a994ef24
commit
d5a3021a7d
14 changed files with 157 additions and 143 deletions
|
@ -16,6 +16,8 @@ import (
|
|||
|
||||
const _RANDOM_AVATAR_SIZE = 200
|
||||
|
||||
// RandomImage generates and returns a random avatar image unique to input data
|
||||
// in custom size (height and width).
|
||||
func RandomImageSize(size int, data []byte) (image.Image, error) {
|
||||
randExtent := len(palette.WebSafe) - 32
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
@ -34,8 +36,8 @@ func RandomImageSize(size int, data []byte) (image.Image, error) {
|
|||
return imgMaker.Make(data), nil
|
||||
}
|
||||
|
||||
// RandomImage generates and returns a random avatar image.
|
||||
// The data should normally be the []byte type of email address.
|
||||
// RandomImage generates and returns a random avatar image unique to input data
|
||||
// in default size (height and width).
|
||||
func RandomImage(data []byte) (image.Image, error) {
|
||||
return RandomImageSize(_RANDOM_AVATAR_SIZE, data)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue