aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/dictionary-importer.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/dictionary-importer.js')
-rw-r--r--ext/js/language/dictionary-importer.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/js/language/dictionary-importer.js b/ext/js/language/dictionary-importer.js
index 98cddf76..5629e197 100644
--- a/ext/js/language/dictionary-importer.js
+++ b/ext/js/language/dictionary-importer.js
@@ -328,13 +328,10 @@ class DictionaryImporter {
const media = new Map();
const context = {archive, media};
- const promises = [];
for (const requirement of requirements) {
- promises.push(this._resolveAsyncRequirement(context, requirement));
+ await this._resolveAsyncRequirement(context, requirement);
}
- await Promise.all(promises);
-
return {
media: [...media.values()]
};
@@ -425,7 +422,7 @@ class DictionaryImporter {
}
// Load file content
- const content = await file.async('base64');
+ let content = await file.async('arraybuffer');
const mediaType = MediaUtil.getImageMediaTypeFromFileName(path);
if (mediaType === null) {
throw createError('Could not determine media type for image');
@@ -435,7 +432,7 @@ class DictionaryImporter {
let width;
let height;
try {
- ({width, height} = await this._mediaLoader.getImageResolution(mediaType, content));
+ ({content, width, height} = await this._mediaLoader.getImageDetails(content, mediaType));
} catch (e) {
throw createError('Could not load image');
}