From fe7c73d5a5f9f952d64b2c26f1bdbc9ece75da32 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 15 Oct 2018 21:29:43 -0300 Subject: [PATCH] Fix Upload file size (#2252) --- app/components/attachment_button.js | 8 ++++---- ios/MattermostShare/ShareViewController.m | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/components/attachment_button.js b/app/components/attachment_button.js index 4a5140bfc..f1185102e 100644 --- a/app/components/attachment_button.js +++ b/app/components/attachment_button.js @@ -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: { diff --git a/ios/MattermostShare/ShareViewController.m b/ios/MattermostShare/ShareViewController.m index 56a4f17c6..70ac27fce 100644 --- a/ios/MattermostShare/ShareViewController.m +++ b/ios/MattermostShare/ShareViewController.m @@ -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 {