Fix Upload file size (#2252)
This commit is contained in:
parent
19f9418948
commit
fe7c73d5a5
2 changed files with 6 additions and 6 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue