Skip to content

Commit

Permalink
Improved cover extraction code
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed Aug 7, 2024
1 parent ed8e4cc commit de81ecc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/metadata/epub.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ func (e EpubReader) Cover(documentFullPath string, coverMaxWidth int) ([]byte, e
}

for _, val := range opf.Metadata.Meta {
if val.Name == "cover" {
id := val.Content
for _, item := range opf.Manifest.Items {
if item.ID == id {
coverFileName = item.Href
break
}
if val.Name != "cover" {
continue
}
for _, item := range opf.Manifest.Items {
if item.ID == val.Content {
coverFileName = item.Href
break
}
}
}
Expand Down

0 comments on commit de81ecc

Please sign in to comment.