Skip to content

Commit 19c6744

Browse files
committed
Last resort to get the first image in manifest as book cover
1 parent 9265e75 commit 19c6744

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

epub.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ class Resources {
675675
&& item.mediaType.startsWith('image'))
676676
?? this.getItemByHref(this.guide
677677
?.find(ref => ref.type.includes('cover'))?.href)
678+
// last resort: first image in manifest
679+
?? this.manifest.find(item => item.mediaType.startsWith('image'))
678680

679681
this.cfis = CFI.fromElements($$itemref)
680682
}

0 commit comments

Comments
 (0)