![]() |
#1 |
Connoisseur
![]() Posts: 54
Karma: 29
Join Date: Oct 2006
|
Adding epubs to iTunes with cover images
While preparing some of my books for the upcoming iPad I noticed that when importing them into iTunes the metadata and cover image were not coming up correctly.
This data can be added directly in iTunes using the Get Info option but it would be nice if this information was added by people creating books. After a bit of investigating I think I have the solution. For the cover image : Place a jpg or png image in the root folder of your epub before compressing. The image must be named iTunesArtwork with no file extension. For the meta data : Create a file called iTunesMetadata.plist in the root folder of your epub. This file contains a lot of information but below seems to be the minimum to get what is needed for sorting and grouping books in iTunes : Code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>artistName</key> <string>***AUTHOR FIRST LAST***</string> <key>book-info</key> <dict> </dict> <key>comments</key> <string>***COMMENTS***</string> <key>genre</key> <string>***GENRE***</string> <key>itemName</key> <string>***BOOK TITLE***</string> <key>sort-artist</key> <string>***AUTHOR LAST, FIRST***</string> <key>sort-artist-status</key> <integer>1</integer> <key>sort-name</key> <string>***BOOK TITLE***</string> <key>sort-name-status</key> <integer>1</integer> <key>year</key> <integer>1923</integer> </dict> </plist> Would be really nice if Calibre or Sigil created these files when exporting an epub. Sartori |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Are you kidding me? Apple decided to break the EPUB metadata standard?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 54
Karma: 29
Join Date: Oct 2006
|
Hmmm, after playing around it seems iTunes does pull the metadata from the original content.opf file when importing - it then adds it's own iTunes metadata file if you do the Get Info thing in iTunes.
Not sure if this overrides the content.opf file if you make changes to it then re-import. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Lets give it a couple of weeks until the picture becomes clearer.
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Quote:
I was hoping they'd break the standard in a more interesting way. All of this info can be specified using the current OPF techniques. Presumably books bought from their store will have additional fields. Looks like the cover image doesn't need to be extracted before adding the book to iTunes. The <dict> field contains a cover-image-path child, producing: Code:
<dict> <key>cover-image-hash</key> <string>ALLTHESEHASHESAREQUITEINTERESTING</string> <key>cover-image-path</key> <string>cover.jpg</string> </dict> Thus, if your book has the following in its .opf file it will automatically find the cover: Code:
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> ... <meta name="cover" content="cover-image" /> ... </metadata> <manifest> ... <item href="[path to cover image within epub structure]" id="cover-image" media-type="image/jpeg"/> ... </manifest> Last edited by charleski; 04-02-2010 at 06:18 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I wouldn't call adding non existing features breaking a standard. calibre for instance adds series and rating info to the OPF, but in a way that's compatible with the OPF spec.
I wished they'd used the <guide> for the cover instead. |
![]() |
![]() |
![]() |
#7 |
Created Sigil, FlightCrew
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
So let me get this straight... iTunes will pull the metadata from the OPF in the epub and then do... whatever, but to get the cover image to show up you need a <meta> element identifying the ID of the cover image element in the manifest? Is that it?
I agree with Kovid, they really should have gone with the <guide> cover, but I guess I can live with this. |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Of course the scheme they chose is rather calibre friendly, since IIRC calibre generated EPUBs already have that metadata element set.
|
![]() |
![]() |
![]() |
#9 |
Created Sigil, FlightCrew
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
So calibre currently adds a meta element referencing a cover image ID? What was the use case for that before the iPad/iTunes epub import?
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Identifying the actual raster image that is the cover rather than just the HTML wrapper.
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
AFAIK, the guide entry for cover is what ADE uses to generate its thumbnail, so obviously Apple have to do it differently...
|
![]() |
![]() |
![]() |
#12 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
If I remember correctly, Mobipocket also relied on the <meta name="cover"> tag (among other things) for identifying a cover in ePUB files. I use it in my ePUBs, it does not harm and I hoped it could be used some day...
|
![]() |
![]() |
![]() |
#13 | |
Created Sigil, FlightCrew
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
The "plist" used by the iPad/iTunes will not be added to epubs by default, but Sigil will add them if an option is selected, either on export or in an options screen. But we still have to wait a couple of weeks to see how all this turns out. I'll be getting an iPad so I'll be waiting to get some first hand experience with the thing before I start making any iPad-specific changes. Needless to say, iPad support is very high on my list. Sigil is used by a surprising number of ebook publishers and I'm pretty sure they care deeply about this. Last edited by Valloric; 04-03-2010 at 07:51 AM. |
|
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Quote:
I would presume that the hashes and Apple-assigned ID are important for books that are going to the iBookstore. If Apple remains consistent with their past approach to iTunes data, then it's safe for 3rd-party apps to read iTunes-generated xml, but best not to try to write it. BTW, iTunes will recognise the dc:creator opf:file-as attribute and use it to set the artist sort field. I tested a couple of the opf:role codes, but iTunes seems to ignore them. The first dc:creator entry is used as the artist name, no matter what the assigned role is. |
|
![]() |
![]() |
![]() |
#15 |
Created Sigil, FlightCrew
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
From the OP's post I gathered that iTunes will not generate the plist. You say it will. Which one is it? Does it read the OPF for the metadata, or does it need special consideration?
I guess I'll have to go and install iTunes... EDIT: Ah, it seems I missed the OP's subsequent clarification. My bad. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Calibre ePubs crash iTunes with iPad? | inputfreak | Calibre | 3 | 09-14-2011 12:53 PM |
Adding Images To Ebook | gtshadow | Calibre | 3 | 09-29-2010 11:23 AM |
A bug with images in epubs? | Cyclops | ePub | 2 | 09-13-2010 10:57 AM |
Moving ePubs to iTunes? | Neil | Calibre | 12 | 04-04-2010 03:33 PM |
Begun adding EPUB to iTunes | pagansoul | Apple Devices | 0 | 03-31-2010 08:26 AM |