Generate cropped avatar image in the original file type
This commit is contained in:
parent
3e4d465eba
commit
ff9e55ae42
2 changed files with 6 additions and 6 deletions
|
@ -157,8 +157,8 @@ const UserSettings = {
|
|||
}
|
||||
reader.readAsDataURL(file)
|
||||
},
|
||||
submitAvatar (cropper) {
|
||||
const img = cropper.getCroppedCanvas().toDataURL('image/jpeg')
|
||||
submitAvatar (cropper, file) {
|
||||
const img = cropper.getCroppedCanvas().toDataURL(file.type)
|
||||
return this.$store.state.api.backendInteractor.updateAvatar({ params: { img } }).then((user) => {
|
||||
if (!user.error) {
|
||||
this.$store.commit('addNewUsers', [user])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue