Fix Upload file size (#2252)

This commit is contained in:
Elias Nahum
2018-10-15 21:29:43 -03:00
parent 09ed38ca98
commit e1fd773850
2 changed files with 6 additions and 6 deletions

View File

@@ -53,8 +53,8 @@ export default class AttachmentButton extends PureComponent {
attachFileFromCamera = async (mediaType) => {
const {formatMessage} = this.context.intl;
const options = {
quality: 1,
videoQuality: 'high',
quality: 0.8,
videoQuality: 'low',
noData: true,
mediaType,
storageOptions: {
@@ -94,7 +94,7 @@ export default class AttachmentButton extends PureComponent {
attachFileFromLibrary = () => {
const {formatMessage} = this.context.intl;
const options = {
quality: 1,
quality: 0.8,
noData: true,
permissionDenied: {
title: formatMessage({
@@ -133,7 +133,7 @@ export default class AttachmentButton extends PureComponent {
attachVideoFromLibraryAndroid = () => {
const {formatMessage} = this.context.intl;
const options = {
videoQuality: 'high',
videoQuality: 'low',
mediaType: 'video',
noData: true,
permissionDenied: {

View File

@@ -185,7 +185,7 @@ typedef void (^ProviderCallback)(NSString *content, NSString *contentType, BOOL
}
NSURL *tempFileURL = [tempContainerURL URLByAppendingPathComponent: fileName];
BOOL created = [UIImageJPEGRepresentation(image, 1) writeToFile:[tempFileURL path] atomically:YES];
BOOL created = [UIImageJPEGRepresentation(image, 0.8) writeToFile:[tempFileURL path] atomically:YES];
if (created) {
return callback([tempFileURL absoluteString], @"public.image", YES, nil);
} else {
@@ -200,7 +200,7 @@ typedef void (^ProviderCallback)(NSString *content, NSString *contentType, BOOL
return callback(nil, nil, NO, nil);
}
NSURL *tempFileURL = [tempContainerURL URLByAppendingPathComponent: fileName];
BOOL created = [UIImageJPEGRepresentation(image, 0.95) writeToFile:[tempFileURL path] atomically:YES];
BOOL created = [UIImageJPEGRepresentation(image, 0.8) writeToFile:[tempFileURL path] atomically:YES];
if (created) {
return callback([tempFileURL absoluteString], @"public.image", YES, nil);
} else {