futurepress / epub.js

Enhanced eBooks in the browser.
http://futurepress.org
Other
6.42k stars 1.1k forks source link

Problem showing inlined images #734

Open benzht opened 6 years ago

benzht commented 6 years ago

EPUBJS.VERSION = "0.2.19"

We experience problems showing an ePub with inlined images in OEBPS/Untitled-2-1.xhtml. When loading, each inlined image is reported in the console with:

"File not found in the epub: OEBPS/data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78AAAAL0lEQVQ4T2NgYGA4AMQNZGKQXoaG////M5CDoYaMGjBqwKgB1DLgAANmNiUWHwAA8XVo0ydibBwAAAAASUVORK5CYII="

and the stack trace: "Error at EPUBJS.Unarchiver.getUrl (https://example.com/js/thirdparty/epub.min.js:8:98591) at EPUBJS.replace.srcs (https://example.com/js/thirdparty/epub.min.js:8:92042) at https://example.com/js/thirdparty/epub.min.js:8:40092 at EPUBJS.Chapter.<anonymous> (https://example.com/js/thirdparty/epub.min.js:8:39343) at Array.forEach (<anonymous>) at EPUBJS.Chapter.replace (https://example.com/js/thirdparty/epub.min.js:8:39314) at EPUBJS.Chapter.replaceWithStored (example.com/js/thirdparty/epub.min.js:8:39724) at EPUBJS.replace.resources (https://example.com/js/thirdparty/epub.min.js:8:91707) at https://example.com/js/thirdparty/epub.min.js:8:56351 at Array.forEach (<anonymous>)"

Help would be very appreciated.

drweb86-work commented 5 years ago

Epubjs isn't supporting them. Also your epub becomes large. Convert images from base64 to png, then PNG to JPEG with 75% quality, reference them in package.opf and use them.