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 4 additions and 5 deletions

View file

@ -70,7 +70,7 @@
"@welshman/signer": "^0.8.4",
"@welshman/store": "^0.8.4",
"@welshman/util": "^0.8.4",
"compressorjs": "^1.2.1",
"compressorjs-next": "^1.1.2",
"daisyui": "^4.12.24",
"date-picker-svelte": "^2.17.0",
"dotenv": "^16.6.1",

Binary file not shown.

View file

@ -7,7 +7,6 @@
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
import Magnifier from "@assets/icons/magnifier.svg?dataurl"
import {fly} from "@lib/transition"
import PageContent from "@lib/components/PageContent.svelte"
import Button from "@lib/components/Button.svelte"
import Icon from "@lib/components/Icon.svelte"
import {deriveEventsForUrl} from "@app/core/state"
@ -92,7 +91,7 @@
const onRoomSearchResultClick = (event: TrustedEvent) => {
close()
void goToEvent(event, {keepFocus: true})
goToEvent(event, {keepFocus: true})
}
</script>

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 => {