diff options
author | Unknwon <u@gogs.io> | 2016-02-20 17:10:05 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-20 17:10:05 -0500 |
commit | d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505 (patch) | |
tree | 2a2c54eb587a4875b742f932398af99d140297ea /modules/avatar | |
parent | d8a994ef243349f321568f9e36d5c3f444b99cae (diff) | |
download | gitea-d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505.tar.gz gitea-d5a3021a7d86a6dbf42df97c5c25e22b0b3f9505.zip |
Make markdown as an independent module
Diffstat (limited to 'modules/avatar')
-rw-r--r-- | modules/avatar/avatar.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index 3d885eb3d4..e9d0c1282e 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -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) } |