Generate cropped avatar image in the original file type

This commit is contained in:
taehoon 2019-03-04 21:22:32 -05:00
parent 3e4d465eba
commit ff9e55ae42
2 changed files with 6 additions and 6 deletions

View file

@ -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])