dev
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import * as RadioGroup from '$lib/components/ui/radio-group';
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import * as Field from '$lib/components/ui/field';
|
||||
import { fileToBase64 } from '$lib/shared';
|
||||
|
||||
import ImageUpload from '$lib/components/custom/image-upload/image-upload.svelte';
|
||||
import { genDescription } from '$lib/db/items.remote';
|
||||
@@ -19,10 +20,7 @@
|
||||
async function onSelect(file: File) {
|
||||
isGenerating = true;
|
||||
|
||||
const buffer = await file.arrayBuffer();
|
||||
const base64 = btoa(
|
||||
String.fromCharCode(...new Uint8Array(buffer))
|
||||
);
|
||||
const base64 = await fileToBase64(file);
|
||||
|
||||
description = await genDescription(base64);
|
||||
isGenerating = false;
|
||||
|
||||
Reference in New Issue
Block a user