From 4e6310962b63ab46579ecb25885d10a0ef5ba661 Mon Sep 17 00:00:00 2001 From: Michael Sweet Date: Sat, 8 Apr 2017 18:42:30 -0400 Subject: [PATCH] Change how we embed the cover image so that more applications show it. --- mxmldoc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mxmldoc.c b/mxmldoc.c index 20d8c63..e7f348c 100644 --- a/mxmldoc.c +++ b/mxmldoc.c @@ -3942,13 +3942,6 @@ write_epub(const char *epubfile, /* I - EPUB file (output) */ status |= zipcCreateFileWithString(epub, "mimetype", mimetype); - /* - * Add the cover image, if specified... - */ - - if (coverimage) - status |= zipcCopyFile(epub, "iTunesArtwork", coverimage, 0, 0); - /* * The META-INF/ directory... */ @@ -3982,7 +3975,7 @@ write_epub(const char *epubfile, /* I - EPUB file (output) */ unlink(xhtmlfile); /* - * Add the cover image again, if specified... + * Add the cover image, if specified... */ if (coverimage) @@ -4035,6 +4028,13 @@ write_epub(const char *epubfile, /* I - EPUB file (output) */ snprintf(identifier, sizeof(identifier), "%s-%s", epubbase, docversion); mxmlNewOpaque(temp, identifier); + if (coverimage) + { + temp = mxmlNewElement(metadata, "meta"); + mxmlElementSetAttr(temp, "name", "cover"); + mxmlElementSetAttr(temp, "content", "cover-image"); + } + manifest = mxmlNewElement(package, "manifest"); temp = mxmlNewElement(manifest, "item"); @@ -4051,7 +4051,7 @@ write_epub(const char *epubfile, /* I - EPUB file (output) */ if (coverimage) { temp = mxmlNewElement(manifest, "item"); - mxmlElementSetAttr(temp, "id", "cover"); + mxmlElementSetAttr(temp, "id", "cover-image"); mxmlElementSetAttr(temp, "href", "cover.png"); mxmlElementSetAttr(temp, "media-type", "image/png"); }