Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-15-2013, 05:10 AM   #1
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: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Introducing New tool: "Polish" Books

The latest calibre release (0.9.19) has a new feature "Polish Books". To use it go to Preferences->Toolbars and add the Polish Books action to the main toolbar, then select the books you want polished and click "Polish books".

Quote:
Polishing books is all about putting the shine of perfection onto your carefully crafted ebooks.

Polishing tries to minimize the changes to the internal code of your ebook. Unlike conversion, it does not flatten CSS, rename files, change font sizes, adjust margins, etc. Every action performs only the minimum set of changes needed for the desired effect.

You should use this tool as the last step in your ebook creation process.

Note that polishing only works on files in the AZW3 or EPUB formats.
Currently the operations you can perform are:

Subsetting embedded fonts

Subsetting fonts means reducing an embedded font to contain only the characters used from that font in the book. This greatly reduces the size of the font files (halving the font file sizes is common). For example, if the book uses a specific font for headers, then subsetting will reduce that font to contain only the characters present in the actual headers in the book. Or if the book embeds the bold and italic versions of a font, but bold and italic text is relatively rare, or absent altogether, then the bold and italic fonts can either be reduced to only a few characters or completely removed. The only downside to subsetting fonts is that if, at a later date you decide to add more text to your books, the newly added text might not be covered by the subset font.

Updating metadata

This will update the metadata and covers in the book files to match the current metadata in the calibre library.

When updating covers in epub files that do not have a correctly identified cover, it will insert a new cover at the start of the book.

Adding/removing metadata jackets

It can add or remove metadata jackets from the ebook files. A metadata jacket is a page at the begining of the book that lists all the book's metadata: title/authors/series/ratings/tags/comments etc.

Note that this feature is based on a completely new codebase, so there may be bugs.

You can also use it from the command line: http://manual.calibre-ebook.com/cli/ebook-polish.html

Last edited by kovidgoyal; 02-15-2013 at 05:15 AM.
kovidgoyal is offline   Reply With Quote
Old 02-15-2013, 06:07 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Thanks for this - I will use it to inject metadata & update cover in EPUB's

Couple of suggestions
  1. Default to using same settings as last time - currently defaults to everything off
  2. Provide Polish Books specific setting for creation of the backup file (ORIGINAL_EPUB etc). I would prefer to turn it off for Polish Books, and leave it on for Conversion. In Conversion its existence is a signal to me that I probably did the wrong thing - I do not ordinarily do EPUB->EPUB conversions
  3. Make the post operation notification/dialogue optional
  4. Expose the the option to update the cover, with three options - remove cover, replace cover, keep cover

I hope our Polish speaking friends don't get confused, on seeing the thread I assumed it was referring to books written in Polish

Which means I have to ask - does it work in Reverse

BR

Last edited by BetterRed; 02-15-2013 at 08:03 AM. Reason: added suggestion relating to cover
BetterRed is offline   Reply With Quote
Advert
Old 02-15-2013, 08:08 AM   #3
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: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1-3: Done.

4. I dont see the point of removing the cover or not updating it if you are updating the rest of the metadata.
kovidgoyal is offline   Reply With Quote
Old 02-15-2013, 08:31 AM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
1-3: Done.

4. I dont see the point of removing the cover or not updating it if you are updating the rest of the metadata.
Thanks for 1-3

Re 4 : Most of my books aren't books as such. They're reports and papers from governments, UN, IMF, EU, thinks tanks etc. Many of them don't have covers, just a Title Page. I generate covers to give me a visual cue in the Book Details pane - but I prefer that they don't appear in the EPUB Files - I currently use Modify plug in to remove them.

I included the keep cover suggestion for 'completeness'

BR
BetterRed is offline   Reply With Quote
Old 02-15-2013, 06:58 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Doesn't seem to work on multiple books - any plans ?

Thanks br
BetterRed is offline   Reply With Quote
Advert
Old 02-15-2013, 11:00 PM   #6
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: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sure it does. Why do you say it doesn't?
kovidgoyal is offline   Reply With Quote
Old 02-15-2013, 11:23 PM   #7
Apache
Readaholic
Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.Apache ought to be getting tired of karma fortunes by now.
 
Apache's Avatar
 
Posts: 5,210
Karma: 90000000
Join Date: Sep 2011
Location: South Georgia
Device: Surface Pro 6 / Galaxy Tab A 8"
Thank you for this.
Apache
Apache is offline   Reply With Quote
Old 02-16-2013, 12:23 AM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Sure it does. Why do you say it doesn't?
I was mighty surprised when it didn't

Did some tests

It doesn't seem to work if I select all the books currently displayed in the list - if I select less it works fine.

I tend to work on batches of 10-40 documents, so ctrl/a gets lots of use.

BR
BetterRed is offline   Reply With Quote
Old 02-16-2013, 12:27 AM   #9
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: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What exactly do you mean by it doesn't work? I tried Ctrl+A and then clicking on polish. Te polish dialog's title said it was polishing 287 books (all the books in my library that had either epub or azw3 files).
kovidgoyal is offline   Reply With Quote
Old 02-16-2013, 01:51 AM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
The background job doesn't start - no arrow pointing at the spinner, no activity in the Jobs queue, no calibre-parallel.exe and no console task.

The books I'm using to test only have EPUBs, there's only seven books in the library, other batch operations work fine, conversion, metadata edits, modify, resize covers etc. I've tried removing the ORIGINAL_EPUBS between tests - no effect.

And its not only when I select all books - sometimes 4 of 7 don't work. Its very weird because there's no obvious repeatable pattern.

If a bulk operation on 4 books doesn't work, and then I Polish one book; then if I try the bulk Polish on the 4 books immediately after that - the bulk Polish works - but I'm not a 100% sure of that's true 100% of the time.

I might leave it until the update with my suggestions 1-3 is released - doing repeated tests is 'tiresome', but those changes will make it easier. In the meantime I can use Modify as I have been.

BR
BetterRed is offline   Reply With Quote
Old 02-16-2013, 03:02 AM   #11
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: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I think I know what the bug is. It will only manifest if you try to polish more than 5 books, fixed in next release.
kovidgoyal is offline   Reply With Quote
Old 02-16-2013, 04:24 AM   #12
Joan M
Did someone say Python?
Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.Joan M 's ceiling is 100% spider-free.
 
Joan M's Avatar
 
Posts: 69
Karma: 118162
Join Date: Nov 2012
Location: USA
Device: Kindle, Kindle Paperwhite, Nook Tablet
"Polish Books"??? No thanks, I only speak English.

Oh! You mean, Enhance Books (or some such). Come on now, folks, I bet I wasn't the only one who clicked on the details for the update announcement, saw something about Polish Books and thought, "never mind; not applicable to me."
Joan M is offline   Reply With Quote
Old 02-16-2013, 04:36 AM   #13
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Great to see this feature.

A trivial item - the description for remove book jacket is the same as book jacket (aka insert book jacket).

As for the name, I'd have to agree that my first thought (especially since P was capitalized) was that it was about the Polish language But reading the details definitely made it interesting. Not that choosing another name doesn't have its own issues. Tweak is already taken Maybe Modify, Tidy, Clean... Sometimes harder choosing the name than coding the function
meme is offline   Reply With Quote
Old 02-16-2013, 05:29 AM   #14
adrian1944
Connoisseur
adrian1944 has a complete set of Star Wars action figures.adrian1944 has a complete set of Star Wars action figures.adrian1944 has a complete set of Star Wars action figures.adrian1944 has a complete set of Star Wars action figures.
 
Posts: 74
Karma: 342
Join Date: Sep 2008
Location: England
Device: Imac, iPhone SE, iPad Air 2, Ipad Mini, Ipad Pro, Sony 650.
error message in polish books

I have managed to use this very useful function with some books but now have had three in a row failing with the same error



calibre, version 0.9.19 (darwin, isfrozen: True)
Conversion Error: Failed: Polish Black Plumes

Polish Black Plumes
Python function terminated unexpectedly: 'NoneType' object has no attribute 'lower'
Found existing cover page
Existing cover page is a simple wrapper, removing it
Traceback (most recent call last):
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 147, in main
return run_entry_point()
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 116, in run_entry_point
return getattr(pmod, func)()
File "site-packages/calibre/utils/ipc/worker.py", line 189, in main
File "site-packages/calibre/ebooks/oeb/polish/main.py", line 171, in gui_polish
File "site-packages/calibre/ebooks/oeb/polish/main.py", line 131, in polish
File "site-packages/calibre/ebooks/oeb/polish/cover.py", line 39, in set_cover
File "site-packages/calibre/ebooks/oeb/polish/cover.py", line 257, in set_epub_cover
File "site-packages/calibre/ebooks/oeb/polish/replace.py", line 47, in replace_links
AttributeError: 'NoneType' object has no attribute 'lower'


regards




adrian
adrian1944 is offline   Reply With Quote
Old 02-16-2013, 06:36 AM   #15
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Thanks, Kovid - this looks like a very useful feature.

May I request a possible enhancement? The most common operation I do to "polish" a book is to remove spaces between paragraphs. Would it be possible to add this as a "polish" operation, rather than it also doing all the other changes to the book that a standard conversion does?
HarryT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New polish sources fenuks Recipes 0 10-02-2011 10:18 AM
Google unveils new tool for searching its digitized books DMcCunney News 4 12-19-2010 07:58 PM
Google uses anti-fraud tool to help digitize books Wetdogeared News 14 09-18-2009 09:51 PM
eLibPro 1.3 - Windows tool to organize your e-books Alexander Turcic Deals and Resources (No Self-Promotion or Affiliate Links) 1 02-06-2005 10:44 PM


All times are GMT -4. The time now is 05:00 PM.


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