Crop avatar image using minWidth/minHeight

This commit is contained in:
taehoon 2019-02-08 11:01:50 -05:00
parent a001ffecf0
commit 09949fc7ee
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ const UserSettings = {
reader.readAsDataURL(file) reader.readAsDataURL(file)
}, },
submitAvatar (cropper) { submitAvatar (cropper) {
const img = cropper.getCroppedCanvas({ width: 150, height: 150 }).toDataURL('image/jpeg') const img = cropper.getCroppedCanvas({ minWidth: 150, minHeight: 150 }).toDataURL('image/jpeg')
this.avatarUploading = true this.avatarUploading = true
this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => { this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
if (!user.error) { if (!user.error) {