You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cryptid/cryptide_project/src/ImageHelper.ts

14 lines
429 B

async function loadImageAsync(url: string): Promise<string> {
try {
const response = await fetch(url);
const blob = await response.blob();
// Faire quelque chose avec le blob, par exemple, créer une URL blob
const blobUrl = URL.createObjectURL(blob);
return blobUrl
} catch (error) {
throw new Error("Erreur lors du chargement de l'image :");
}
}
export {loadImageAsync}