[PR #4106] [MERGED] Fix: Load epub covers via cover-image property #4170

Closed
opened 2026-04-25 00:18:38 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4106
Author: @Roukanken42
Created: 3/11/2025
Status: Merged
Merged: 3/12/2025
Merged by: @advplyr

Base: masterHead: fix/loading-epub-covers


📝 Commits (1)

  • b86797a Fix: Load epub covers via cover-image property

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 server/utils/parsers/parseEpubMetadata.js (+5 -1)

📄 Description

Brief summary

Adds ability to load epub covers via cover-image property in manifest if the cover meta entry is missing.

Which issue is fixed?

Fixes #4105

In-depth Description

The implementation respects the EPUB 3.3 spec, and loads property="cover-image maybe-other-props" tagged manifest items as cover image, in case the cover metadata entry is missing. Fallback to the first image is still present if neither metadata entry, nor property can be found.

How have you tested this?

I've used this epub as example where this can help. Simply importing this into ABS will have the wrong cover before this change, but the good one after reimporting it with the change. (Same cover as Calibre loads)

Screenshots

Before:
image

After:
image

Calibre:
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4106 **Author:** [@Roukanken42](https://github.com/Roukanken42) **Created:** 3/11/2025 **Status:** ✅ Merged **Merged:** 3/12/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix/loading-epub-covers` --- ### 📝 Commits (1) - [`b86797a`](https://github.com/advplyr/audiobookshelf/commit/b86797a2452fedc0c0f5a898f9a396f313a17432) Fix: Load epub covers via cover-image property ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/parsers/parseEpubMetadata.js` (+5 -1) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary <!-- Please provide a brief summary of what your PR attempts to achieve. --> Adds ability to load epub covers via [cover-image property](https://www.w3.org/TR/epub-33/#sec-cover-image) in manifest if the cover meta entry is missing. ## Which issue is fixed? <!-- Which issue number does this PR fix? Ex: "Fixes #1234" --> Fixes #4105 ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it solve a problem that affects multiple users or is this an edge case for your setup? --> The implementation respects the [EPUB 3.3 spec](https://www.w3.org/TR/epub-33/#attrdef-item-properties), and loads `property="cover-image maybe-other-props"` tagged manifest items as cover image, in case the cover metadata entry is missing. Fallback to the first image is still present if neither metadata entry, nor property can be found. ## How have you tested this? <!-- Please describe in detail with reproducible steps how you tested your changes. --> I've used this [epub](https://github.com/IDPF/epub3-samples/releases/download/20230704/epub30-spec.epub) as example where this can help. Simply importing this into ABS will have the wrong cover before this change, but the good one after reimporting it with the change. (Same cover as Calibre loads) ## Screenshots Before: ![image](https://github.com/user-attachments/assets/bd3b4275-e3cb-4d48-8283-a42c87fd6a9f) After: ![image](https://github.com/user-attachments/assets/c6f7fe86-0b5c-40c9-9016-290407c784c2) Calibre: ![image](https://github.com/user-attachments/assets/7ba3abc7-f816-483b-9ed1-bfa73c8670d8) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:38 +02:00
adam closed this issue 2026-04-25 00:18:38 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4170