Descriptive error messages for video stories
This commit is contained in:
parent
c038c07b06
commit
4549291b7b
16 changed files with 289 additions and 179 deletions
|
@ -3,10 +3,7 @@
|
|||
|
||||
import { omit } from 'lodash';
|
||||
import { blobToArrayBuffer } from 'blob-util';
|
||||
import * as log from '../logging/log';
|
||||
import { getValue } from '../RemoteConfig';
|
||||
|
||||
import { parseIntOrThrow } from './parseIntOrThrow';
|
||||
import { scaleImageToLevel } from './scaleImageToLevel';
|
||||
import type { AttachmentType } from '../types/Attachment';
|
||||
import { canBeTranscoded } from '../types/Attachment';
|
||||
|
@ -14,26 +11,6 @@ import type { LoggerType } from '../types/Logging';
|
|||
import * as MIME from '../types/MIME';
|
||||
import * as Errors from '../types/errors';
|
||||
|
||||
export const KIBIBYTE = 1024;
|
||||
const MEBIBYTE = 1024 * 1024;
|
||||
const DEFAULT_MAX = 100 * MEBIBYTE;
|
||||
|
||||
export const getMaximumAttachmentSizeInKb = (): number => {
|
||||
try {
|
||||
return (
|
||||
parseIntOrThrow(
|
||||
getValue('global.attachments.maxBytes'),
|
||||
'preProcessAttachment/maxAttachmentSize'
|
||||
) / KIBIBYTE
|
||||
);
|
||||
} catch (error) {
|
||||
log.warn(
|
||||
'Failed to parse integer out of global.attachments.maxBytes feature flag'
|
||||
);
|
||||
return DEFAULT_MAX / KIBIBYTE;
|
||||
}
|
||||
};
|
||||
|
||||
// Upgrade steps
|
||||
// NOTE: This step strips all EXIF metadata from JPEG images as
|
||||
// part of re-encoding the image:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue