Skip to content

Commit 46f7f78

Browse files
author
Irene Alvarado
committed
Add await to functions and load lib from url
1 parent 0b12891 commit 46f7f78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/image/image-example.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { loadImage, loadImageBytes } from '../../image.ts'
1+
import { loadImage, loadImageBytes } from 'https://deno.land/x/flat@0.0.3/mod.ts'
22
import { Image } from 'https://cdn.deno.land/imagescript/versions/1.2.0/raw/mod.ts'; // library for image manipulations
33

44
const url = 'https://api.creativecommons.engineering/v1/thumbs/c8fe5f5b-cc1a-4794-91c5-7488c60f4914'
@@ -7,13 +7,13 @@ const url3 = 'https://i.giphy.com/media/5wWf7HapUvpOumiXZRK/giphy.gif'
77

88
// Can specify a filename to rename the image
99
// (image url, path to save image, image to save name)
10-
loadImage(url, './examples/image/', 'cat')
10+
await loadImage(url, './examples/image/', 'cat')
1111

1212
// Image will be saved with the default name if not included
13-
loadImage(url2, './examples/image/')
13+
await loadImage(url2, './examples/image/')
1414

1515
// Can load gifs, pngs, jpgs
16-
loadImage(url3, './examples/image/', 'cat-gif')
16+
await loadImage(url3, './examples/image/', 'cat-gif')
1717

1818
// Image manipulation example - reading from a file
1919
const bytes = await Deno.readFile('./examples/image/cat.jpeg') // local file

0 commit comments

Comments
 (0)