Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Cover image on Mac epub icon or in Apple Books. #10505

Closed
shoesforindustry opened this issue Jan 1, 2025 · 4 comments
Closed

No Cover image on Mac epub icon or in Apple Books. #10505

shoesforindustry opened this issue Jan 1, 2025 · 4 comments
Labels

Comments

@shoesforindustry
Copy link

I just compiled a book and it has no book cover image on the icon or when added to Apple Books.
Mac 15.2 (24C101) - Pandoc pandoc 3.6.1 - iMac M3.

So I then proceeded to compile a book I had compiled under a previous version of Pandoc. This too had no cover image icon on Mac finder or in apple books.

Some images might make it clearer:
In Finder:
versions

In Apple Books:
Screenshot 2025-01-01 at 10 18 06

Same book, same compile system but different results?

The last time the original books was compiled was August 6th 2024, so I guess it would have been pandoc 3.3 2024-07-28 via homebrew.

I had a look at the Release notes for later versions of pandoc and checked if anything had changed to the epub image and could only find:
"pandoc 3.6 (2024-12-07)
EPUB writer: Use standardized filename for cover image instead of the original name (#10404). This avoids problems with e.g. filenames containing spaces."

Anyone any ideas?

@jgm
Copy link
Owner

jgm commented Jan 1, 2025

How did you tell pandoc to use a cover image? Did you use --epub-cover-image on the command line or include cover-image: in YAML metadata? Is the cover image present at the path you specified?

@jgm
Copy link
Owner

jgm commented Jan 1, 2025

PS. Cover images still work in my tests.

@shoesforindustry
Copy link
Author

shoesforindustry commented Jan 6, 2025

Hi John, thanks for the prompt reply and apologies for my tardiness, a winter virus intervened... anyway after a bit of research I have found the following example to illustrate the issue.

book.md

---
title: Book Title
cover-image: cover-image.jpg
---

# Heading 1

Some text

Compile with:

pandoc book.md --to epub2 -o book.epub

And you get no icon for the epub in Mac Finder or the book cover in Apple Books.

Looking at the files I see in the content.opf (after the change to using file0 for the cover image) the issue:

<meta name="cover" content="cover-image_jpg" /> 

Which I think should reference file0, and indeed changing it to...

 <meta name="cover" content="file0_jpg" /> 

...means you can see the icon for the epub in Mac Finder and the book cover in Apple Books.

I'm not sure if this is just for epub2? But I hope this helps in identifying the issue.

Russ

@jgm
Copy link
Owner

jgm commented Jan 6, 2025

I can confirm this. I had tested before with epub3; this problem only appears with epub2.

@jgm jgm closed this as completed in ad105a3 Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants