Fix Upload file size (#2252)

This commit is contained in:
Elias Nahum 2018-10-15 21:29:43 -03:00 committed by GitHub
parent 19f9418948
commit fe7c73d5a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {