diff --git a/package-lock.json b/package-lock.json index 65fdb4a..ea09bc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "jepub", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e3b8ef7..abababe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jepub", - "version": "2.1.0", + "version": "2.1.1", "description": "Generate simple EPUB books with JavaScript.", "main": "src/jepub.js", "scripts": { diff --git a/src/jepub.js b/src/jepub.js index eea4728..cab3d40 100644 --- a/src/jepub.js +++ b/src/jepub.js @@ -101,8 +101,10 @@ export default class jEpub { ext = utils.mime2ext(mime); } else if (data instanceof ArrayBuffer) { ext = imageType(new Uint8Array(data)); - mime = ext.mime; - if (ext) ext = utils.mime2ext(mime); + if (ext) { + mime = ext.mime; + ext = utils.mime2ext(mime); + } } else { throw 'Cover data is not valid'; }