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]
|
else this.metadata[key] = [value]
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.getCover = () => {
|
this.getCover = async () => {
|
||||||
const href = this.resources?.cover?.href
|
const cover = this.resources?.cover
|
||||||
return href ? this.loadBlob(href) : null
|
return cover?.href
|
||||||
|
? new Blob([await this.loadBlob(cover.href)], { type: cover.mediaType })
|
||||||
|
: null
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user