function convertMedia(uri, type, width, height, callback) {
  const fileType = type == 'photo' ? 'jpg' : 'mov'
  const fileName = guid() + '.' + fileType

  CameraRollConvert.read(uri, width, height, (base64) => {
    if (base64) {
      const file = new Parse.File(fileName, {base64: base64})
      file.save({
        success(isSaved) {
          callback(isSaved)
        },
        error(error) {
          callback(error)
        }
      })
    } else {
      callback(false)
    }
  })
}
/**
 * Converts an asset file from the camera roll into a base64 encoded string.
 *
 * @param {string} uri - the asset URI
 * @param {string} type - the type of asset (jpg or mov)
 * @param {number} width - the width of the asset
 * @param {number} height - the height of the asset
 * @param {function} {callback} - function to call after the asset has been transformed
 * @return {void}
 */
Converts an asset file from the camera roll into a base64 encoded string.
Converts an asset file from the camera roll into a base64 encoded string .
function convertMedia(uri, type, width, height, callback) {
  const fileType = type == 'photo' ? 'jpg' : 'mov'
  const fileName = guid() + '.' + fileType
  CameraRollConvert.read(uri, width, height, (base64) => {
    if (base64) {
      const file = new Parse.File(fileName, {base64: base64})
      file.save({
        success(isSaved) {
          callback(isSaved)
        },
        error(error) {
          callback(error)
        }
      })
    } else {
      callback(false)
    }
  })
}
function convertMedia ( uri , type , width , height , callback ) { const fileType = type == 'photo' ? 'jpg' : 'mov' const fileName = guid ( ) + '.' + fileType CameraRollConvert . read ( uri , width , height , ( base64 ) => { if ( base64 ) { const file = new Parse . File ( fileName , { base64 : base64 } ) file . save ( { success ( isSaved ) { callback ( isSaved ) } , error ( error ) { callback ( error ) } } ) } else { callback ( false ) } } ) }
Converts an asset file from the camera roll into a base64 encoded string.
Converts an asset file from the camera roll into a base64 encoded string .