Achieve consistency by using a single Image type

This commit is contained in:
2019-06-04 13:37:59 +09:00
parent 3d526f9198
commit dd36c852d3
14 changed files with 21 additions and 20 deletions

View File

@ -65,8 +65,8 @@ type UserAvatar struct {
LastModified int64 `json:"lastModified"`
}
// SetAvatarBytes accepts a byte buffer that represents an image file and updates the avatar.
func (user *User) SetAvatarBytes(data []byte) error {
// SetImageBytes accepts a byte buffer that represents an image file and updates the avatar.
func (user *User) SetImageBytes(data []byte) error {
// Decode
img, format, err := image.Decode(bytes.NewReader(data))