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
validation errors in content.opf #9493
Comments
This doesn't affect the problem but note that I forgot in my demo to specify output format = epub3. Anyway, playing around with it some more, I see that removing the offending line <meta property="cover" content="cover_jpg" /> from content.opf resolves the validation issue. If I'm reading it right, it looks like in the epub3 specification the correct way to specify the cover is to set an item with properties "cover-image", which pandoc is doing: <item properties="cover-image" id="cover_jpg" href="media/cover.jpg" media-type="image/jpeg" /> |
Use `--epub-cover-image` to catch issues that only arise with that. See #9493.
thanks for reporting! |
I just noticed something else about this. With the validation error in place, Google Play would not successfully upload the epub. If I delete that "cover" element from the content.opf, then the validation is clean, and Play imports it, but it doesn't show the cover on the thumbnail. This suggests that in the Pandoc 3+-generated epub, vs the Pandoc 2+ version, there's something not quite right about how the cover art is configured. (Or deleting that content element has some unexpected side effect. Or Google Play has an issue.) |
I don't know. We're doing everything mentioned in the resource you linked. But if you find something we should be doing that we aren't, let us know. |
I think the problem is that it wants this line in the manifest: <item id="cover" href="media/cover.jpg" media-type="image/jpeg"/> instead of this: <item properties="cover-image" id="cover_jpg" href="media/cover.jpg" media-type="image/jpeg"/> When I make this change it validates and the thumbnail works. |
OK, so I've been looking at this in more detail and here's what I see... I'm attaching a zip with two versions of content.opf: the original version of the that Pandoc creates ("fails.xml") which doesn't work, and my corrected version ("works.xml") that validates and also has a working cover image in Google Play Books. |
Is the only change the one you note above? cover-image -> cover ? |
I think there's 2 changes. I think it's the 2 changes that have come up in this discussion, but if you diff the XML files in the zip you'll see for sure. I find that epub3 spec pretty hard to understand. And I'm a little suspicious that Google should not need the cover in the manifest, that it's a holdover from epub 2, but it seems it does. |
On this issue it seems pretty clear. I can't find anywhere that says to use "cover" instead of "cover-image" in this context. I'm not going to make pandoc do something that goes against the explicit language of the spec -- it seems to me that this is a Google Play issue. iBooks, for example, has no trouble showing the cover image for the epubs we produce. |
A couple points: I don't think it violates the spec — the epub still validates; I think it's a backwards-compatibility consideration. Also bear in mind that Pandoc 2x does not have this problem. Its epub3 files both validate and the covers work. You might consider having a switch for this. Finally it's worth researching more thoroughly than I have. I was just knocking around to figure out a workaround for the validation issue and the cover image issue. |
Just upgraded Pandoc and I'm getting a new validation error. This does not happen with Pandoc 2.19.2.
pandoc version:
Converting markdown to epub.
markdown:
# Header 1 Foobar.
commandline: C:\scratch\pandoc bug> pandoc test.md -o test.epub --epub-cover-image "cover.jpg" --metadata title="test book"
Now when I run an epub validator:
Here's what content.opf looks like:
pandoc bug.zip
The text was updated successfully, but these errors were encountered: