Use compressorjs-next

This commit is contained in:
Jon Staab
2026-02-16 11:34:46 -08:00
parent 3d268f1f9d
commit c9954db3fe
4 changed files with 10 additions and 25 deletions
+2 -2
View File
@@ -140,13 +140,13 @@ export const compressFile = async (
file: File | Blob,
options: Record<string, any> = {},
): Promise<File> => {
const {default: Compressor} = await import("compressorjs")
const {default: Compressor} = await import("compressorjs-next")
return new Promise<File>((resolve, _reject) => {
new Compressor(file, {
maxWidth: 2048,
maxHeight: 2048,
convertSize: 10 * 1024 * 1024,
convertTypes: ["image/png"],
...options,
success: result => resolve(result as File),
error: e => {