Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2012, 03:17 AM   #1
DragonflyKing
Enthusiast
DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.
 
DragonflyKing's Avatar
 
Posts: 27
Karma: 9040
Join Date: Mar 2012
Device: Kobo Touch
Conversion over-wrote my edited epub file

Here is what happened to me yesterday:
I wanted to edit a book to improve its format but thought I should make a backup in case I wrecked the file. The easiest way for me to do that from within Calibre was to convert the epub (without making any changes) so that an original_epub file would be created. After backing up the book I used the Open With (Sigil) add-in and spent the next hour reformatting my book. After saving my book in Sigil, I closed Sigil and checked that it still opened in Calibre. So far all was fantastic...but I noticed a typo in the metadata. I corrected the typo and reconverted the book to incorporate the metadata change into the book. OOPS.

I forgot that Calibre always converts from original_epub to epub. Because I had made a backup original_epub Calibre used that as the source of the conversion and over-wrote my epub file. My hour of edits was lost.

This has happened to me before when making search/replace regular expression edits with the Calibre conversion tool itself. It is not possible to make incremental search/replace modifications without deleting the original_epub file between conversions (danger of losing everything).

Would it be possible to configure Calibre to always use the epub file as the source of any conversion. That way Sigil or Regular Expression Search/Replaces would be incremental.

Would it be possible to always replace the original_epub file with a numerically index file so that multiple copies (at various stages of edit) could be kept. e.g. When converting title.epub the original file becomes title.1.original_epub. When title.epub is converted again the latest title.epub becomes title.2.original_epub etc.
DragonflyKing is offline   Reply With Quote
Old 12-23-2012, 05:19 AM   #2
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: 8,781
Karma: 12516053
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by DragonflyKing View Post
So far all was fantastic...but I noticed a typo in the metadata. I corrected the typo and reconverted the book to incorporate the metadata change into the book. OOPS.
The metadata gets updated every time you export the ePub from the library, so if you do a Save to disk or a Send to device the metadata is updated during the export process. Also if you just want the metadata of the in-library ePub updated you can use the Modify ePub plugin.

Quote:
Originally Posted by DragonflyKing View Post
I forgot that Calibre always converts from original_epub to epub. Because I had made a backup original_epub Calibre used that as the source of the conversion and over-wrote my epub file. My hour of edits was lost.
Live and learn. Beside the stated metadata typo why else would you want to reconvert a book you just spent time editing to look as you wish it to look?

Quote:
Originally Posted by DragonflyKing View Post
Would it be possible....
Anything is possible. The question is if you can convince Kovid it is a good idea and if there is someone to do the programming to create the patch required. You can submit an enhancement request by following these instructions.

Good Reading.
DoctorOhh is offline   Reply With Quote
Old 12-23-2012, 06:28 AM   #3
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Quote:
Originally Posted by DoctorOhh View Post
Beside the stated metadata typo why else would you want to reconvert a book you just spent time editing to look as you wish it to look?
This was my thought too. Reconverting takes you back to your starting point and loses all your manual edits. The way calibre uses original ePub is to specifically NOT do incremental conversions of an ePub. I find it's main use is in establishing conversion options for a particular book and it then makes total sense to work from original ePub.

My method for working on conversions is as follows:

Use a library for finished books, (e.g. MAIN)
Use a second library for work in progress, (e.g. WORK).

(1) Any new source document, (usually a plain text file), starts life in the WORK library.

(2) Set the Metadata.

(3) Convert to ePub and check result.
If options need to be changed then do so and repeat (3).
(This is where original ePub comes in use)

(4) Copy book from WORK to MAIN, (but do not switch to MAIN).

(5) Use calibre's Tweak book function to explode the WORK ePub and with preferred text editor apply manual edits, proof reading corrections, regexes, style updates, etc.

Alternatively this could be done with Sigil.

Check changes in calibre reader and ADE. If there's more to do then repeat (5).

(6) When a 'milestone' point is reached, (or the book is finished), then goto (4).

This way you can incrementally improve your ePub and if any stage goes wrong you have a milestone version to revert to.

Notes

Conversions never takes place in the MAIN library, (therefore no scope for accidents. It would be nice to have an option in calibre to actually lock out conversions on a per library basis, but for now this is just discipline).

Books are only sent to my reader from MAIN, never from WORK. (I preview them from WORK using calibre reader and ADE.)

When the book is finished I delete it from WORK. If it later become active again the simply copy from MAIN to WORK and go to (5).

If metadata changes are later required then use the Modify ePub plugin.


Hope this helps.

Last edited by Agama; 12-23-2012 at 06:35 AM.
Agama is offline   Reply With Quote
Old 12-23-2012, 06:39 AM   #4
DragonflyKing
Enthusiast
DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.DragonflyKing can eat soup with a fork.
 
DragonflyKing's Avatar
 
Posts: 27
Karma: 9040
Join Date: Mar 2012
Device: Kobo Touch
I simplified what I was doing to make my post readable.
I think the intent of the original_epub is to prevent loss of work. I was trying to explain a couple of simple, typical, scenarios where it failed to do that and then went on to suggest an alternative and the benefits it would have.

The extra conversion was done because I have "Insert metadata as page at start of book" checked. It is this page, within the book itself, that I wanted to update.

Thanks for the link. I'll post my request there.
DragonflyKing is offline   Reply With Quote
Old 12-23-2012, 06:47 AM   #5
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: 8,781
Karma: 12516053
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by DragonflyKing View Post
The extra conversion was done because I have "Insert metadata as page at start of book" checked. It is this page, within the book itself, that I wanted to update.
FYI, This page can also be updated/replaced, removed or added via the Modify ePub plugin without doing a conversion.
DoctorOhh is offline   Reply With Quote
Old 12-23-2012, 03:36 PM   #6
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,586
Karma: 25107878
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
Quote:
Originally Posted by DragonflyKing View Post

Would it be possible to always replace the original_epub file with a numerically index file so that multiple copies (at various stages of edit) could be kept. e.g. When converting title.epub the original file becomes title.1.original_epub. When title.epub is converted again the latest title.epub becomes title.2.original_epub etc.
Seems like a major PITA to me. Calibre only allows one format type per record and I would not want an unlimited number as it would be hard to know which was which after a while.

You could use save to disk to place your working copy in a work directory and edit this copy with sigil, using save as to track incremental updates, then transfer the finished product back to calibre using the box in the left hand bottom corner of the edit metadata screen.

Helen
speakingtohe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion fail from chm file to epub, pdf, etc.. VictorTalbot Conversion 0 10-20-2012 10:26 PM
add css file to epub conversion VICTORSJG Calibre 0 09-21-2011 07:38 AM
Large File Conversion MOBI -> ePub Hangs at 67% Snauzoo Conversion 3 06-07-2011 01:03 PM
older pdb file to epub conversion fibrou Calibre 4 12-27-2010 12:13 AM
Mistakenly overwrote edited epub file -- Can I recover? PatNY Calibre 3 08-23-2010 07:55 PM


All times are GMT -4. The time now is 01:57 PM.


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