| 
			
			 | 
		#16 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#17 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 6 
				Karma: 10 
				Join Date: Jan 2010 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#18 | 
| 
			
			
			
			 Zealot 
			
			![]() 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" />  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#19 | |
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 5 
				Karma: 10 
				Join Date: Apr 2010 
				
				
				
				Device: iPhone 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 <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.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#20 | |
| 
			
			
			
			 The Grand Mouse 高貴的老鼠 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 74,447 
				Karma: 318076944 
				Join Date: Jul 2007 
				Location: Norfolk, England 
				
				
				Device: Kindle Oasis 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 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  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#21 | |
| 
			
			
			
			 Member 
			
			![]() Posts: 10 
				Karma: 10 
				Join Date: Apr 2010 
				
				
				
				Device: ipad 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Good Lord... How do I do that in Sigil? Thank you for any help!! Nix  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#22 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#23 | |
| 
			
			
			
			 Created Sigil, FlightCrew 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982 
				Karma: 350515 
				Join Date: Feb 2008 
				
				
				
				Device: Kobo Clara HD 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  
		 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#24 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#25 | 
| 
			
			
			
			 Pulps and dime novels... 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 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 06:35 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#26 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196 
				Karma: 1281258 
				Join Date: Sep 2009 
				
				
				
				Device: PRS-505 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 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.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#27 | 
| 
			
			
			
			 Pulps and dime novels... 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 343 
				Karma: 1952003 
				Join Date: Jan 2009 
				
				
				
				Device: Kobo Aura/Kobo Aura One LE/iPad Air 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#28 | |
| 
			
			
			
			 Pulps and dime novels... 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 343 
				Karma: 1952003 
				Join Date: Jan 2009 
				
				
				
				Device: Kobo Aura/Kobo Aura One LE/iPad Air 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code: 
	zip "path to my.epub" "iTunesMetadata.plist"  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#29 | 
| 
			
			
			
			 Pulps and dime novels... 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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" 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>
- M.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#30 | 
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
| Thread Tools | Search this Thread | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [Old Thread] Calibre ePubs crash iTunes with iPad? | inputfreak | Calibre | 3 | 09-14-2011 01:53 PM | 
| Adding Images To Ebook | gtshadow | Calibre | 3 | 09-29-2010 12:23 PM | 
| A bug with images in epubs? | Cyclops | ePub | 2 | 09-13-2010 11:57 AM | 
| Moving ePubs to iTunes? | Neil | Calibre | 12 | 04-04-2010 04:33 PM | 
| Begun adding EPUB to iTunes | pagansoul | Apple Devices | 0 | 03-31-2010 09:26 AM |