diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-19 10:16:59 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-19 10:16:59 -0400 |
commit | 7faaf4e45737dd06ab3fdf189bd9c1d26ad1349d (patch) | |
tree | 595d741cdde5b88e93189b9e4938ad6a98899cf4 /ext/bg/js | |
parent | 07e5e5c15b20077fd325b2546ae96c5a50d4c1bd (diff) |
Use 'content' instead of 'source' to contain media file data
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/dictionary-importer.js | 6 | ||||
-rw-r--r-- | ext/bg/js/media-utility.js | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/bg/js/dictionary-importer.js b/ext/bg/js/dictionary-importer.js index 8a4497a3..b5c535bb 100644 --- a/ext/bg/js/dictionary-importer.js +++ b/ext/bg/js/dictionary-importer.js @@ -323,7 +323,7 @@ class DictionaryImporter { throw new Error(`Could not find image at path ${JSON.stringify(path)} for ${errorSource}`); } - const source = await file.async('base64'); + const content = await file.async('base64'); const mediaType = mediaUtility.getImageMediaTypeFromFileName(path); if (mediaType === null) { throw new Error(`Could not determine media type for image at path ${JSON.stringify(path)} for ${errorSource}`); @@ -331,7 +331,7 @@ class DictionaryImporter { let image; try { - image = await mediaUtility.loadImage(mediaType, source); + image = await mediaUtility.loadImage(mediaType, content); } catch (e) { throw new Error(`Could not load image at path ${JSON.stringify(path)} for ${errorSource}`); } @@ -346,7 +346,7 @@ class DictionaryImporter { mediaType, width, height, - source + content }; context.media.set(path, mediaData); diff --git a/ext/bg/js/media-utility.js b/ext/bg/js/media-utility.js index 24686838..febc509a 100644 --- a/ext/bg/js/media-utility.js +++ b/ext/bg/js/media-utility.js @@ -52,7 +52,7 @@ const mediaUtility = (() => { } } - function loadImage(mediaType, base64Source) { + function loadImage(mediaType, content) { return new Promise((resolve, reject) => { const image = new Image(); const eventListeners = new EventListenerCollection(); @@ -64,7 +64,7 @@ const mediaUtility = (() => { eventListeners.removeAllEventListeners(); reject(new Error('Image failed to load')); }, false); - image.src = `data:${mediaType};base64,${base64Source}`; + image.src = `data:${mediaType};base64,${content}`; }); } |