fix: properly decode cover href when generating epub cover

Closes: #2118
This commit is contained in:
Gauthier Roebroeck 2025-11-03 10:37:32 +08:00
parent fe40ede34a
commit f8ca936ee7

View file

@ -67,7 +67,7 @@ class EpubExtractor(
?: // try id="cover-image" ?: // try id="cover-image"
manifest.values.firstOrNull { it.id == "cover-image" } manifest.values.firstOrNull { it.id == "cover-image" }
if (coverManifestItem != null) { if (coverManifestItem != null) {
val href = coverManifestItem.href val href = URLDecoder.decode(coverManifestItem.href, Charsets.UTF_8)
val mediaType = coverManifestItem.mediaType val mediaType = coverManifestItem.mediaType
val coverPath = normalizeHref(opfDir, href) val coverPath = normalizeHref(opfDir, href)
zip.getEntryBytes(coverPath)?.let { coverBytes -> zip.getEntryBytes(coverPath)?.let { coverBytes ->