Added photo resizer

This commit is contained in:
John Lyon-Smith
2018-05-14 11:49:36 -07:00
parent fdd5f67d90
commit ab80dd320c

View File

@@ -64,8 +64,14 @@ export class BoundPhotoPanel extends Component {
if (onUploadStarted) {
onUploadStarted()
}
api
.upload(response.path || response.uri, this.props.onUploadProgress)
const uri = response.path || response.uri
createResizedImage(uri, 800, 600, "JPEG", 80)
.then((newUri) => {
return
api.upload(newUri, this.props.onUploadProgress)
})
.then((uploadData) => {
if (onUploadEnded) {
onUploadEnded(true, uploadData)