mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 02:48:23 +01:00
Uint8Array migration
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import loadImage, { LoadImageOptions } from 'blueimp-load-image';
|
||||
import { canvasToArrayBuffer } from './canvasToArrayBuffer';
|
||||
import { canvasToBytes } from './canvasToBytes';
|
||||
|
||||
export async function processImageFile(file: File): Promise<ArrayBuffer> {
|
||||
export async function processImageFile(file: File): Promise<Uint8Array> {
|
||||
const { image } = await loadImage(file, {
|
||||
canvas: true,
|
||||
cover: true,
|
||||
@@ -26,5 +26,5 @@ export async function processImageFile(file: File): Promise<ArrayBuffer> {
|
||||
throw new Error('Loaded image was not a canvas');
|
||||
}
|
||||
|
||||
return canvasToArrayBuffer(image);
|
||||
return canvasToBytes(image);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user