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"); }