Create new File with blob

- maintain filename
- reduce image size
This commit is contained in:
mattwr18 2019-10-16 17:20:35 +02:00
parent 452bf4127c
commit d62ee23f2a

View File

@ -100,8 +100,9 @@ export default {
thumbnailElement.appendChild(image) thumbnailElement.appendChild(image)
// Remove the editor from view // Remove the editor from view
editor.parentNode.removeChild(editor) editor.parentNode.removeChild(editor)
this.$emit('addTeaserImage', blob) const croppedImageFile = new File([blob], file.name, { type: 'image/jpeg' })
}) this.$emit('addTeaserImage', croppedImageFile)
}, 'image/jpeg')
}) })
editor.appendChild(confirm) editor.appendChild(confirm)