diff options
Diffstat (limited to 'client/src/root-helpers/images.ts')
-rw-r--r-- | client/src/root-helpers/images.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/root-helpers/images.ts b/client/src/root-helpers/images.ts index fb229ce6d..c4b09ec3c 100644 --- a/client/src/root-helpers/images.ts +++ b/client/src/root-helpers/images.ts | |||
@@ -1,8 +1,10 @@ | |||
1 | import { logger } from './logger' | ||
2 | |||
1 | function imageToDataURL (input: File | Blob) { | 3 | function imageToDataURL (input: File | Blob) { |
2 | return new Promise<string>(res => { | 4 | return new Promise<string>(res => { |
3 | const reader = new FileReader() | 5 | const reader = new FileReader() |
4 | 6 | ||
5 | reader.onerror = err => console.error('Cannot read input file.', err) | 7 | reader.onerror = err => logger.error('Cannot read input file.', err) |
6 | reader.onloadend = () => res(reader.result as string) | 8 | reader.onloadend = () => res(reader.result as string) |
7 | reader.readAsDataURL(input) | 9 | reader.readAsDataURL(input) |
8 | }) | 10 | }) |