Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-03-2010, 01:04 PM   #16
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Just so it's clear -

If the epub doesn't have an iTuneMetadata.plist in its root, then iTunes will always generate one automatically on importing the file. In this process it scans the opf and extracts certain metadata elements as well as generating a couple of hashes and an ID number whose purposes are currently unclear.

If the epub does have a plist file in its root, then iTunes won't scan the opf metadata and won't generate the hashes or ID. It will simply use the plist as-is and ignore the metadata in the opf.

Any changes to metadata made in iTunes are written only to the plist file.

At the moment epubs do not appear to be included in the xml data created on exporting the iTunes library.
charleski is offline   Reply With Quote
Old 04-08-2010, 04:38 PM   #17
phearlez
Junior Member
phearlez began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2010
Device: Kindle
Quote:
Originally Posted by charleski View Post
At the moment epubs do not appear to be included in the xml data created on exporting the iTunes library.
I'm not surprised by that. The AppleScript/COM interfaces and the export always have seemed to lag behind features.
phearlez is offline   Reply With Quote
Advert
Old 04-09-2010, 10:53 AM   #18
paulpeer
Zealot
paulpeer is on a distinguished road
 
paulpeer's Avatar
 
Posts: 147
Karma: 56
Join Date: Dec 2009
Location: Antwerpen
Device: iPhone, Sony PRS-505, EPUBreader
I've just added
Code:
 <meta name="cover" content="img0001.jpg" />
to 30 of my ePubs, dragged them to iTunes, and they all appear perfectly with cover page and the following meta data: title, creator and subject.
paulpeer is offline   Reply With Quote
Old 04-13-2010, 04:08 PM   #19
MichaelCampbell
Junior Member
MichaelCampbell began at the beginning.
 
MichaelCampbell's Avatar
 
Posts: 5
Karma: 10
Join Date: Apr 2010
Device: iPhone
Quote:
Originally Posted by kovidgoyal View Post
Identifying the actual raster image that is the cover rather than just the HTML wrapper.
Dr. Goyal: I noticed InDesign uses the "cover" metatag in its ePub creation, referencing the XHTML cover page in the manifest. Like this:
<reference type="cover" title="Book Cover" href="Cover.xhtml" />

I've struggled to get the cover art to appear properly in Stanza for iPhone. Is there an advantage to referencing the original CoverArt.jpg rather than the "Cover.xhtml", if when the XHTML file is, as you say, only a wrapper?

I study your posts and those of Valloric. I greatly appreciate your availability on this forum.
MichaelCampbell is offline   Reply With Quote
Old 04-13-2010, 04:23 PM   #20
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by MichaelCampbell View Post
<reference type="cover" title="Book Cover" href="Cover.xhtml" />
This is different to the meta data that iTunes uses. The <reference> element appears in the <guide> element of content.opf, and should indeed reference the xhtml file for the cover.

The meta data needs to appear in the <metadata> element, usually near the start of the .opf file, and would be something like

<meta name="cover" content="cover-image"/>

Note that name="cover" is required, but the "cover-image" bit is arbitrary, and just needs to match the id given in the manifest for the bitmap version of the cover. So, using the above, in the <manifest> element of the .opf file there would also need to be a line

<item id="cover-image" href="images/img0032.png" media-type="image/png"/>

where the id must match the 'content' bit of the meta data, and the href and media-type must correctly identify the cover bitmap.

HTH
pdurrant is offline   Reply With Quote
Advert
Old 04-13-2010, 05:23 PM   #21
nixwinter
Member
nixwinter began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2010
Device: ipad
Quote:
Originally Posted by charleski View Post
You're surprised???

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>
Which then shows as the cover in iTunes. It seems that iTunes looks for a metatdata element named "cover" and then uses the image with the corresponding id.

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>

Good Lord...
How do I do that in Sigil?

Thank you for any help!!

Nix
nixwinter is offline   Reply With Quote
Old 04-14-2010, 01:52 AM   #22
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@MichaelCampbell: Referencing the raster image directly is of advantage in the scenario where a library app like calibre, or iTunes or Stanza needs to extract a cover from the EPUB.

If such a reference is present calibre will use it to efficiently extract the cover image. If it is absent calibre will render the first html file to get the cover. Other software, like iTunes is less capable and in the absence of the reference will simply fail to extract the cover.
kovidgoyal is online now   Reply With Quote
Old 04-14-2010, 07:28 AM   #23
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
If such a reference is present calibre will use it to efficiently extract the cover image. If it is absent calibre will render the first html file to get the cover.
Had I known this before, I would have added the functionality to Sigil a long time ago. You should have said something Kovid.
Valloric is offline   Reply With Quote
Old 04-14-2010, 09:00 AM   #24
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
no big deal, actually in the absence of the reference, calibre first scans the first html file, if it looks like a wrapper (i.e. no text and only one <img> or <svg:image> element it figures out the raster cover from that
kovidgoyal is online now   Reply With Quote
Old 07-01-2010, 05:27 PM   #25
Vintage Season
Pulps and dime novels...
Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.
 
Vintage Season's Avatar
 
Posts: 343
Karma: 1952003
Join Date: Jan 2009
Device: Kobo Aura/Kobo Aura One LE/iPad Air
Hmm... for those of us able to properly script an iTunesMetadata.plist file, in order to batch customize our files without worrying about those hashes iTunes insists on generating, would it be possible to give Sigil or Calibre the ability to properly add that file to the root of the *.epub so that the file will still pass epubcheck?

Currently, if I use 7-Zip to simply add the file in the proper location, iTunes accepts it and uses the meta tagging I've specified for grouping and sorting, but epubcheck spits out the following:
Code:
ERROR: test.epub: length of first filename in archive must be 8, but was 20
Simply editing an iTunesMetadata.plist file in place, within the *.epub, also produces the same epubcheck error.

iTunes appears to be adding the iTunesMetadata.plist file without setting any file attributes, if that helps.

(If it would help more, I could also generate some quick xhtml and a couple of test files showing specific examples.)

- M.

Last edited by Vintage Season; 07-01-2010 at 05:35 PM.
Vintage Season is offline   Reply With Quote
Old 07-01-2010, 05:55 PM   #26
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by Vintage Season View Post
Currently, if I use 7-Zip to simply add the file in the proper location, iTunes accepts it and uses the meta tagging I've specified for grouping and sorting, but epubcheck spits out the following:
Code:
ERROR: test.epub: length of first filename in archive must be 8, but was 20
Just checked this, and 7-zip rewrites the archive in a way that moves the mimetype file away from its required position at the start of the archive.
No of characters in 'mimetype': 8. No of characters in 'iTunesMetadata.plist': 20.

The problem lies with 7zip re-ordering the file, and there's not much that can be done unless the 7zip team decides to change it. It looks like 7zip simply isn't suitable for editing epubs unless you're very careful in recreating the archive after edits. I use WinRAR, largely because it allows you to open internal files straight into an editor of your choice. Unfortunately it's not free, but it's never shown this problem.
charleski is offline   Reply With Quote
Old 07-01-2010, 05:59 PM   #27
Vintage Season
Pulps and dime novels...
Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.
 
Vintage Season's Avatar
 
Posts: 343
Karma: 1952003
Join Date: Jan 2009
Device: Kobo Aura/Kobo Aura One LE/iPad Air
Quote:
Originally Posted by charleski View Post
No of characters in 'mimetype': 8. No of characters in 'iTunesMetadata.plist': 20.
That much, I had figured out.

Thanks for verifying the behavior I encountered, though.

- M.
Vintage Season is offline   Reply With Quote
Old 07-01-2010, 09:50 PM   #28
Vintage Season
Pulps and dime novels...
Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.
 
Vintage Season's Avatar
 
Posts: 343
Karma: 1952003
Join Date: Jan 2009
Device: Kobo Aura/Kobo Aura One LE/iPad Air
Quote:
Originally Posted by charleski View Post
The problem lies with 7zip re-ordering the file, and there's not much that can be done unless the 7zip team decides to change it. It looks like 7zip simply isn't suitable for editing epubs unless you're very careful in recreating the archive after edits. I use WinRAR, largely because it allows you to open internal files straight into an editor of your choice. Unfortunately it's not free, but it's never shown this problem.
Solved... and for anyone interested in doing what I described (manually adding an iTunesMetadata.plist file), you can use Info-Zip's free Zip 3.0 utility to properly add the file, without messing up the order, via the following command line:
Code:
zip "path to my.epub" "iTunesMetadata.plist"
- M.
Vintage Season is offline   Reply With Quote
Old 07-01-2010, 10:44 PM   #29
Vintage Season
Pulps and dime novels...
Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.Vintage Season ought to be getting tired of karma fortunes by now.
 
Vintage Season's Avatar
 
Posts: 343
Karma: 1952003
Join Date: Jan 2009
Device: Kobo Aura/Kobo Aura One LE/iPad Air
... and if it really matters to anyone (iTunes doesn't seem to care) whether or not the Archive bit is cleared (which is iTunes' current manner of handling the task, although the resultant filesize seems to be the same either way), that can be accomplished by using this line instead of the earlier one:
Code:
zip -AC "path to my.epub" "iTunesMetadata.plist"
... which allows one to include specific iTunes tags and sorting structure, such as this, in a custom iTunesMetadata.plist:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
	<key>artistName</key>
	<string>AuthorFirstName AuthorLastName</string>
	<key>book-info</key>
	<dict>
		<key>cover-image-path</key>
		<string>OEBPS/Images/cover.jpg</string> <-- make sure this is correct for your book!
	</dict>
	<key>genre</key>
	<string>Genre</string>
	<key>itemName</key>
	<string>Title</string>
	<key>releaseDate</key>
	<string>yyyy-mm-dd</string>
	<key>sort-artist</key>
	<string>AuthorLastName, AuthorFirstName</string>
	<key>work</key>
	<string>Grouping/Series (if applicable)</string>
	<key>sort-name</key>
	<string>Grouping/Series (if applicable) Number (if applicable): Title</string>
</dict>
</plist>
Assuming your *.epub passed validation before you added the iTunesMetadata.plist, and you follow this method, it should still pass after you add the file.

- M.
Vintage Season is offline   Reply With Quote
Old 07-05-2010, 09:21 AM   #30
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Just take a look at how Calibre does the cover. It works fine in iBooks.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:51 AM.


MobileRead.com is a privately owned, operated and funded community.