support receiving images from the Web Share Target API Level 2 and directly opening AI image recognition on mobile version

This commit is contained in:
MaysWind
2026-03-08 15:25:19 +08:00
parent 5ce1dc973c
commit 282b74c95e
8 changed files with 130 additions and 8 deletions
@@ -70,12 +70,12 @@ const cancelRecognizingUuid = ref<string | undefined>(undefined);
const imageFile = ref<File | null>(null);
const imageSrc = ref<string | undefined>(undefined);
function loadImage(file: File): void {
function loadImage(image: Blob): void {
loading.value = true;
imageFile.value = null;
imageSrc.value = undefined;
compressJpgImage(file, 1280, 1280, 0.8).then(blob => {
compressJpgImage(image, 1280, 1280, 0.8).then(blob => {
imageFile.value = KnownFileType.JPG.createFileFromBlob(blob, "image");
imageSrc.value = URL.createObjectURL(blob);
loading.value = false;
@@ -184,6 +184,10 @@ function onSheetOpen(): void {
function onSheetClosed(): void {
close();
}
defineExpose({
loadImage
});
</script>
<style>