mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
EPUB: set content type for cover blob
Although the type can often be auto-detected, it's better to set it explicitly, especially for SVGs.
This commit is contained in:
@@ -689,9 +689,11 @@ export class EPUB {
|
||||
else this.metadata[key] = [value]
|
||||
}))
|
||||
|
||||
this.getCover = () => {
|
||||
const href = this.resources?.cover?.href
|
||||
return href ? this.loadBlob(href) : null
|
||||
this.getCover = async () => {
|
||||
const cover = this.resources?.cover
|
||||
return cover?.href
|
||||
? new Blob([await this.loadBlob(cover.href)], { type: cover.mediaType })
|
||||
: null
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user