Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-08-2013, 06:06 PM   #1
strongnc21
Junior Member
strongnc21 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2013
Device: iPad
Writing Calibre Metadata directly into ePub files?

Hi all, newbie here.

Correct me if I'm wrong, but it seems to me that Calibre preserve the original ePub that you import. Any "metadata" changes aren't actually applied to the ebook file (I'm using ePub for all of my books). Instead, a book cover is stored in the same directory as the eBook (eg, .jpg), and the metadata is actually sotred in a ".opf" file.

Example:
Spoiler:
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuid_id">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlnspf="http://www.idpf.org/2007/opf">
<dc:identifier opf:scheme="calibre" id="calibre_id">58</dc:identifier>
<dc:identifier opf:scheme="uuid" id="uuid_id">fabc6e5f-dba8-471d-b4f3-595101d2a608</dc:identifier>
<dc:title>Foundation</dc:title>
<dc:creator opf:file-as="Asimov, Isaac" opf:role="aut">Isaac Asimov</dc:creator>
<dc:contributor opf:file-as="calibre" opf:role="bkp">calibre (1.2.0) [http://calibre-ebook.com]</dc:contributor>
<dc:date>1951-01-02T05:00:00+00:00</dc:date>
<dc:description>&lt;div&gt;&lt;p&gt;For twelve thousand years the Galactic Empire has ruled supreme. Now it is dying. But only Hari Sheldon, creator of the revolutionary science of psychohistory, can see into the future—to a dark age of ignorance, barbarism, and warfare that will last thirty thousand years. To preserve knowledge and save mankind, Seldon gathers the best minds in the Empire—both scientists and scholars—and brings them to a bleak planet at the edge of the Galaxy to serve as a beacon of hope for a fututre generations. He calls his sanctuary the Foundation.&lt;br&gt;&lt;/p&gt;&lt;p&gt;But soon the fledgling Foundation finds itself at the mercy of corrupt warlords rising in the wake of the receding Empire. Mankind's last best hope is faced with an agonizing choice: submit to the barbarians and be overrun—or fight them and be destroyed.&lt;/p&gt;&lt;h3&gt;Amazon.com Review&lt;/h3&gt;&lt;p&gt;&lt;em&gt;Foundation&lt;/em&gt; marks the first of a series of tales set so far in the future that Earth is all but forgotten by humans who live throughout the galaxy. Yet all is not well with the Galactic Empire. Its vast size is crippling to it. In particular, the administrative planet, honeycombed and tunneled with offices and staff, is vulnerable to attack or breakdown. The only person willing to confront this imminent catastrophe is Hari Seldon, a psychohistorian and mathematician. Seldon can scientifically predict the future, and it doesn't look pretty: a new Dark Age is scheduled to send humanity into barbarism in 500 years. He concocts a scheme to save the knowledge of the race in an Encyclopedia Galactica. But this project will take generations to complete, and who will take up the torch after him? The first Foundation trilogy (&lt;em&gt;Foundation&lt;/em&gt;, &lt;em&gt;Foundation and Empire&lt;/em&gt;, &lt;em&gt;Second Foundation&lt;/em&gt won a Hugo Award in 1965 for "Best All-Time Series." It's science fiction on the grand scale; one of the classics of the field. &lt;em&gt;--Brooks Peck&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;From the Inside Flap&lt;/h3&gt;&lt;p&gt;For twelve thousand years the Galactic Empire has ruled supreme. Now it is dying. But only Hari Sheldon, creator of the revolutionary science of psychohistory, can see into the future--to a dark age of ignorance, barbarism, and warfare that will last thirty thousand years. To preserve knowledge and save mankind, Seldon gathers the best minds in the Empire--both scientists and scholars--and brings them to a bleak planet at the edge of the Galaxy to serve as a beacon of hope for a fututre generations. He calls his sanctuary the Foundation.&lt;br&gt;&lt;/p&gt;&lt;p&gt;But soon the fledgling Foundation finds itself at the mercy of corrupt warlords rising in the wake of the receding Empire. Mankind's last best hope is faced with an agonizing choice: submit to the barbarians and be overrun--or fight them and be destroyed. &lt;/p&gt;&lt;/div&gt;</dc:description>
<dcublisher>Spectra</dcublisher>
<dc:identifier opf:scheme="AMAZON">0553382578</dc:identifier>
<dc:identifier opf:scheme="GOOGLE">IwywDY4P6gsC</dc:identifier>
<dc:identifier opf:scheme="ISBN">9780553293357</dc:identifier>
<dc:language>eng</dc:language>
<meta content="{&quot;Isaac Asimov&quot;: &quot;&quot;}" name="calibre:author_link_map"/>
<meta content="Foundation" name="calibre:series"/>
<meta content="3" name="calibre:series_index"/>
<meta content="8.0" name="calibre:rating"/>
<meta content="0101-01-01T05:00:00+00:00" name="calibre:timestamp"/>
<meta content="Foundation" name="calibre:title_sort"/>
</metadata>
<guide>
<reference href="Foundation - Isaac Asimov.jpg" title="Cover" type="cover"/>
</guide>
</package>


My question is, is there any way to ditch the separate metadata and separate cover files, and write that data directly to the ePub file? That way, everything is contained within the single file?

Is it a file type issue? Should I not be using ePub? That seems odd though, if you use Calibre to "explode" an ebook, there is definitely a cover file inside of it, and probably the metadata too, I have to assume...

Anyway... thanks.
strongnc21 is offline   Reply With Quote
Old 09-08-2013, 06:12 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
See the "Polish Books" function (select the books and right-click). This function permits you to update metadata and covers in most epubs.
chaley is offline   Reply With Quote
Advert
Old 09-08-2013, 06:41 PM   #3
strongnc21
Junior Member
strongnc21 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2013
Device: iPad
Do you mean, "Tweak Books"? Because that's a lot of manual work to do on an entire library.

I don't see a "Polish Books" option under the right-click context menu. :-s
strongnc21 is offline   Reply With Quote
Old 09-08-2013, 06:45 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by strongnc21 View Post
Do you mean, "Tweak Books"? Because that's a lot of manual work to do on an entire library.

I don't see a "Polish Books" option under the right-click context menu. :-s
Nope. I mean Polish Books. If you don't have it, then probably your calibre installation is too old or it has been removed from the context menu (Preferences / Toolbar / The context menu for books in the calibre library).
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.png
Views:	1691
Size:	24.1 KB
ID:	110611  
chaley is offline   Reply With Quote
Old 09-08-2013, 07:21 PM   #5
strongnc21
Junior Member
strongnc21 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2013
Device: iPad
Holy cannoli. It worked!

Thanks!
strongnc21 is offline   Reply With Quote
Advert
Old 09-09-2013, 12:25 AM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,895
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
I'm glad you figured out how to use the Polish books feature. The response below is for others that may follow.

Quote:
Originally Posted by strongnc21 View Post
Correct me if I'm wrong, but it seems to me that Calibre preserve the original ePub that you import. Any "metadata" changes aren't actually applied to the ebook file (I'm using ePub for all of my books). Instead, a book cover is stored in the same directory as the eBook (eg, .jpg), and the metadata is actually sotred in a ".opf" file.
The metadata for all of your books is actually stored in the metadata.db file. The individual opf files you see in the directories contain info (yes metadata) for use in disaster recovery to restore the library (metadata.db) in case of corruption.

In addition to the separate cover being used to update the book it is used in displaying the calibre library via the GUI.

Quote:
Originally Posted by strongnc21 View Post
My question is, is there any way to ditch the separate metadata and separate cover files, and write that data directly to the ePub file? That way, everything is contained within the single file?
No because as described above those files are used for other purposes within calibre.

However, please note that with epub files whenever a book is exported from the calibre library the metadata and cover are updated in the book. So if you used the Send to device, Save to disk, email to, features or obtained the book via the content server the epub should have the cover and metadata you see in calibre embedded into the epub.

Folks that ask for the books in the library to be updated are usually grabbing the book directly from the library folder instead of exporting the book via calibre's many sanctioned methods. Typically this occurs when folks use cloud sync software like Dropbox on their device to grab the books as they need them. In this use case the user would have to use the Polish books feature to embed the cover and metadata into the library copy of the book.

Quote:
Originally Posted by strongnc21 View Post
Is it a file type issue? Should I not be using ePub? That seems odd though, if you use Calibre to "explode" an ebook, there is definitely a cover file inside of it, and probably the metadata too, I have to assume...
Personally I think ePub is the best choice. Many of the books may have a cover and metadata embedded in them as any time you convert a book the cover and metadata are embedded during the conversion process.
DoctorOhh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TidBITS: iBooks Now Opens EPUB Files Directly kjk Apple Devices 4 04-07-2011 03:07 PM
Language metadata in ePub files HarryT Calibre 24 07-19-2010 10:24 PM
Writing metadata to PDF files in Calibre asts18 Calibre 3 03-23-2010 01:07 PM
Quick metadata from ePUB files Jellby ePub 0 02-14-2010 06:11 AM
Sending files directly to PRS500 without Calibre quicksilver Calibre 6 12-23-2009 04:58 PM


All times are GMT -4. The time now is 06:11 PM.


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