Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2012, 10:44 PM   #1
Colerson
Nameless Being
 
Converting ePub->ePub on device transfer

One feature of Calibre that I really like is the ability to normalize various format settings (paragraph breaks, etc) and to smarten quotes during the conversion process. Because I have a Nook, and most of my books are ePubs from Gutenberg, I have to convert ePub to ePub manually in order to get this behavior. Is it possible to have Calibre always convert to ePub (even when the source is ePub) when transferring to my Nook, so I automatically get these enhancements?

What I am really aiming for is a way to keep source files unchanged. This is because conversion is an inherently lossy process. My rationale is that if Calibre gains an enhancement in the conversion process (e.g. smartypants becomes even smarter and produces the proper quotation mark even more often), I want to be able to convert from the original again. I can currently keep backups easily enough, but if Calibre can do on-the-fly conversion without touching the source, I would be ecstatic. I never read on my computer so it doesn't bother me if they have straight quotes, bad paragraph breaks, etc. I would just like an unchanging source for any future conversions.
  Reply With Quote
Old 02-08-2012, 10:57 PM   #2
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: 45,168
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
When calibre does an epub to epub conversion the original is saved as original_epub in the book record (unless you turned off that feature in Preferences->Tweaks).
kovidgoyal is offline   Reply With Quote
Advert
Old 02-08-2012, 11:35 PM   #3
Colerson
Nameless Being
 
How utterly wonderful.

I'd been under the impression that if I converted multiple times, the original would simply be overwritten by the previous conversion. Either I never tested it or I tested incorrectly. This is 100% precisely what I want and, of course, Calibre already supports it.

Thank you!
  Reply With Quote
Old 02-09-2012, 12:43 AM   #4
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: 45,168
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This feature was introduced relatively recently, so make sure you have an up to date calibre release.
kovidgoyal is offline   Reply With Quote
Old 02-09-2012, 12:03 PM   #5
Colerson
Nameless Being
 
I have the latest version, and it works perfectly: original_epub is preferred to epub, if it exists.

I do have a question regarding other formats: basically, I'm extending my original question to conversion from any format to epub, always using the original for later conversions. After poking through the source, I've come to the following conclusion:

If you perform an individual conversion of a book, it stores the source format in the gui_preferred_input_format field in the conversion_options table.

If you perform a bulk convert, all books that have gui_preferred_input_format set will use that format (so if I convert a .mobi to .epub, bulk convert will always prefer .mobi for future conversions). Books without gui_preferred_input_format will use the priority list.

This means books will always be converted from the original format, unless I delete the associated rows in the conversion_options table. This is important for me because I'm planning on deleting all rows from that table to clear out custom conversion options I may have set while experimenting.

Is my understanding correct?
  Reply With Quote
Advert
Old 02-09-2012, 12:22 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Colerson View Post
I have the latest version, and it works perfectly: original_epub is preferred to epub, if it exists.

I do have a question regarding other formats: basically, I'm extending my original question to conversion from any format to epub, always using the original for later conversions. After poking through the source, I've come to the following conclusion:

If you perform an individual conversion of a book, it stores the source format in the gui_preferred_input_format field in the conversion_options table.

If you perform a bulk convert, all books that have gui_preferred_input_format set will use that format (so if I convert a .mobi to .epub, bulk convert will always prefer .mobi for future conversions). Books without gui_preferred_input_format will use the priority list.

This means books will always be converted from the original format, unless I delete the associated rows in the conversion_options table. This is important for me because I'm planning on deleting all rows from that table to clear out custom conversion options I may have set while experimenting.

Is my understanding correct?
You can use the 'Restore Defaults' button on the Single book conversion screen, to make Calibre 'forget' the last used (per book) setting.

If you use the Bulk Metadata edit form on a selection of books, there is a tick box near the middle right to do the same thing
theducks is online now   Reply With Quote
Old 02-09-2012, 01:59 PM   #7
Colerson
Nameless Being
 
Quote:
Originally Posted by theducks View Post
You can use the 'Restore Defaults' button on the Single book conversion screen, to make Calibre 'forget' the last used (per book) setting.

If you use the Bulk Metadata edit form on a selection of books, there is a tick box near the middle right to do the same thing
Ok, great, thanks; that appears to be the equivalent of dropping the row from the database.

If so, that would have the same issue of forgetting my preferred input format, right? So if I have my "master", say, .mobi that I'd converted to .epub, if I restore defaults, Calibre will now convert from .epub to .epub by default (since epub has a higher priority as an input than mobi).

Is there a way, independent of other conversion options, to force a particular book to have a "master" format? E.g. I'd like, when I add a book to Calibre, to set the book's original format as the master format, even if I hit "restore defaults" later on. If there's not a way to do this currently, I think it'll be easy enough for me to hack into Calibre, which raises the question of whether I should send a resulting patch in, or whether it's too narrow of a feature to really be useful for anybody else.
  Reply With Quote
Old 02-09-2012, 02:20 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Colerson View Post
Ok, great, thanks; that appears to be the equivalent of dropping the row from the database.

If so, that would have the same issue of forgetting my preferred input format, right? So if I have my "master", say, .mobi that I'd converted to .epub, if I restore defaults, Calibre will now convert from .epub to .epub by default (since epub has a higher priority as an input than mobi).

Is there a way, independent of other conversion options, to force a particular book to have a "master" format? E.g. I'd like, when I add a book to Calibre, to set the book's original format as the master format, even if I hit "restore defaults" later on. If there's not a way to do this currently, I think it'll be easy enough for me to hack into Calibre, which raises the question of whether I should send a resulting patch in, or whether it's too narrow of a feature to really be useful for anybody else.
Not really

Calibre will make an 'Original_xx' if you convert from-to the same format. That will be used if you convert the same again, but ?? if you convert to other formats.
Input and (device) Output preference list order prevail on send and conversions.
theducks is online now   Reply With Quote
Old 02-09-2012, 06:01 PM   #9
Colerson
Nameless Being
 
Thanks for the info.

I discovered that I can find the imported file type by looking for the first matching entry in the data table. From there it was a simple matter of modifying get_input_format_for_book to prefer this format over all others, giving me the result I wanted. I can now convert and restore defaults with impunity, knowing the original will always be used.
  Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
epub to epub converting: making chapters? Joy736 Conversion 8 10-30-2011 04:47 PM
Save original when converting epub to epub? fitzhugh Conversion 18 07-28-2011 12:29 AM
Transfer ePub to Kindle? Baldrake Amazon Kindle 6 11-15-2010 05:22 PM
Epub to ipad transfer ???!!! doc hollywood Apple Devices 3 02-15-2010 11:11 AM
converting epub to epub gandor62 Calibre 1 08-13-2009 12:27 AM


All times are GMT -4. The time now is 08:25 PM.


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