mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-21 21:01:29 +01:00
Composer: Support non-standard JPG extensions (#1517)
This commit is contained in:
parent
b3e96a51c7
commit
ff16a6411b
@ -9,6 +9,7 @@ import {
|
||||
import { scaleImage } from '../../../../util/imageResize';
|
||||
|
||||
const MAX_QUICK_IMG_SIZE = 1280; // px
|
||||
const FILE_EXT_REGEX = /\.[^/.]+$/;
|
||||
|
||||
export default async function buildAttachment(
|
||||
filename: string, blob: Blob, isQuick: boolean, options?: Partial<ApiAttachment>,
|
||||
@ -30,6 +31,10 @@ export default async function buildAttachment(
|
||||
return buildAttachment(filename, newBlob, true, options);
|
||||
}
|
||||
|
||||
if (mimeType === 'image/jpeg') {
|
||||
filename = filename.replace(FILE_EXT_REGEX, '.jpg');
|
||||
}
|
||||
|
||||
quick = { width, height };
|
||||
} else {
|
||||
previewBlobUrl = blobUrl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user