mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-13 07:15:30 +00:00
Change how we embed the cover image so that more applications show it.
This commit is contained in:
parent
c9b78a862c
commit
4e6310962b
18
mxmldoc.c
18
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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user