Skip to content

Instantly share code, notes, and snippets.

@mecaneer23
Created August 12, 2024 01:39
Show Gist options
  • Select an option

  • Save mecaneer23/1257ef9c503e2444d2c2c55a2db3ee4f to your computer and use it in GitHub Desktop.

Select an option

Save mecaneer23/1257ef9c503e2444d2c2c55a2db3ee4f to your computer and use it in GitHub Desktop.
Image creation from external url example
console.log("Image creation from external url example");
async function createLocalImageFrom(imageUrl) {
let blob = fetch(imageUrl).then(r => r.blob());
let img = document.createElement("img");
img.src = URL.createObjectURL(await blob);
document.body.appendChild(img);
}
// createLocalImageFrom("");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment