Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2011, 10:27 AM   #1
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,679
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
[GUI Plugin] Modify ePub

This plugin offers a way to perform certain modifications to your selected ePub files without performing a calibre conversion. This plugin was created a number of months ago and has a history documented in the Development forum on this thread.

Performing an ePub->ePub conversion will enforce a number of changes to your ePub, some of which can be undesirable for some users. Examples are the rewriting of CSS, margin modifications, file splitting in undesired places, changes to directory structure etc.

Instead this plugin allows a user specific subset of changes to be performed in isolation without otherwise touching the original ePub's file structure, CSS files etc. Frequently these changes have been performed manually by users either using the Tweak ePub feature (time consuming), by editing in Sigil (which introduces changes/side effects of its own), by doing ePub->ePub conversions, or by saving to disk and reimporting into calibre.

Users may also find it useful to install the Quality Check plugin, which offers the ability to identify ePubs in your library which qualify for many of the modifications this plugin can make.

Refer to the Help file accessed from the plugin dialog or below for full details on each of the modification options and when you might use them.

Main Features:
  • Remove iTunes artifact files
  • Remove Calibre bookmark files
  • Remove OS artifact files such as Thumbs.db
  • Remove unused image files
  • Removing missing file entries from the .opf manifest
  • Add unmanifested files to manifest
  • Remove unmanifested files from ePub
  • Remove non dc: metadata from manifest
  • Flatten TOC hierarchy in NCX file
  • Remove broken link TOC entries in NCX file
  • Remove margins from Adobe .xpgt files
  • Remove Adobe .xpgt files and links
  • Remove Adobe resource DRM meta tags
  • Remove all metadata jackets
  • Remove legacy metadata jackets
  • Add/replace metadata jacket
  • Encode HTML in UTF-8 to fix invalid HTML encodings.
  • Remove embedded fonts
  • Modify @page and body margin styles
  • Append extra CSS to each .css file
  • Smarten punctuation
  • Remove inline javascript and .js files
  • Remove html pages containing nothing but broken image links
  • Completely remove an existing cover
  • Insert a new cover or replace an existing one using your desired proportions/svg choice from Preferences->Output Options->EPUB
  • Update metadata
  • Save and restore your preferred settings with a single click
  • Optional script to run from command line
  • Remove Adobe pagemaps
  • Move metadata jackets to end of book
  • Remove excess whitespace and useless markup from HTML
  • Remove Kobo-specific artifacts from KEPUBs

Special Notes:
Paypal Donations:
  • If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!
Attached Files
File Type: zip Modify ePub.zip (334.6 KB, 2289 views)

Last edited by kiwidude; 09-30-2024 at 05:12 AM. Reason: New release
kiwidude is offline   Reply With Quote
Old 10-22-2011, 07:45 PM   #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: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Excellent, it will now be easier to refer folks to this plugin.
DoctorOhh is offline   Reply With Quote
Advert
Old 10-23-2011, 12:22 AM   #3
bizzybody
Addict
bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.bizzybody ought to be getting tired of karma fortunes by now.
 
Posts: 294
Karma: 7742186
Join Date: Apr 2007
Location: Idaho, USA
Device: Various PalmOS PDAs, Android Phones, Sharper Image Literati
Here's a feature request, a function to edit or remove text color settings in the stylesheet.css file. I spent a lot of time trying different converters from epub to Mobi but none of them would get rid of what had the text locked to black (actually a really really dark grey). Finally, in response to a post in the epub forum, I was pointed to Sigil and looking for references to color in stylesheet.css. I found three instances of color: #231F20; deleted them and saved. Then the book converted without the text color locked.

I figure the best setup would be to find each color setting and show an example of what changing or removing each setting will do. Might not want to remove *all* the color settings, in this book the TOC links and chapter headings are set to "blue" while the rest of the text was 231F20. I left the "blue" and removed the others.

Boggles me why anyone would set a color to look like printed "black" ink when black text is the default on readers and reader software.

I read on my LED screen phone in white on black because it improves the battery life a bunch VS black on white. Black pixels on LED screens use zero power, VS white pixels on LCD using zero power, other than the backlight shining through. No backlight on LED.
bizzybody is offline   Reply With Quote
Old 10-23-2011, 12:54 AM   #4
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,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Kiwidude, let me state it a little simpler. It would be nice if you could add the option to remove text color and remove background color to the plugin.

Last edited by DoctorOhh; 10-23-2011 at 01:16 AM.
DoctorOhh is offline   Reply With Quote
Old 10-25-2011, 06:51 PM   #5
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,679
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@bizzybody/dwanthny - modifying the css via this plugin is one of those things I personally have avoided to date, though I guess Idolse must be doing with his additions to this plugin. It has to be done in a bulletproof way while minimising the changes to the css, which means not using third party css parsing code for instance. It should be possible using regular expressions but needs careful application and a lot of testing. I want people to have confidence that when they use this plugin it lives up to its billing of making the least changes possible to do their task, instead of the potential gotchas associated with alternatives.

You have to handle potentially mutiple css files, and also inline css as well...

If I do take the leap at some point, certainly stripping colors could be an option to support. I would add to that wish list things options like line-height, letter-spacing and font-family too, no doubt there are others I've forgotten.
kiwidude is offline   Reply With Quote
Advert
Old 10-25-2011, 09:45 PM   #6
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by kiwidude View Post
@bizzybody/dwanthny - modifying the css via this plugin is one of those things I personally have avoided to date, though I guess Idolse must be doing with his additions to this plugin. It has to be done in a bulletproof way while minimising the changes to the css, which means not using third party css parsing code for instance.

You have to handle potentially mutiple css files, and also inline css as well...
I haven't taken the leap and done my whole library with the plugin yet, but I've modified dozens if not a couple hundred ePub's css using this plugin. The code works in all the ways you describe at this point - multiple css files are supported, inline styles in the html, etc. It would be trivial to modify other css styles - the other thing it seems people want is to automatically add/remove justification.

I think the trick would be to apply all the css modifications at once though, so it would require a bit of a re-design of the current function - basically a top level modify css, then a bunch of sub-functions - sort of like heuristics.
ldolse is offline   Reply With Quote
Old 10-26-2011, 10:15 PM   #7
Magnus
Enthusiast
Magnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheeseMagnus can extract oil from cheese
 
Posts: 33
Karma: 1010
Join Date: Jun 2011
Device: none
I'm quite naive here... but I noticed that when I run the plugin I get:

Looking for non dc: elements in manifest
Removing child: {http://www.idpf.org/2007/opf}meta


After I've modified the ePub, the result persists when I again run the plugin. Why is that? What have I overlooked?
Magnus is offline   Reply With Quote
Old 10-27-2011, 03:58 AM   #8
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,679
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Magnus - what "result persists"are you referring to? Send me a PM with a link to the ePub and more detail on what it is doing the you don't expect it to.
kiwidude is offline   Reply With Quote
Old 11-02-2011, 09:37 AM   #9
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
Glad to see this made it to prime time! Thanks guys!

I looked at the issue of line spacing a while ago and discovered that a popular technique for setting line spacing is to manipulate the font size (set the paragraph class to, say, font-size 1.3em, line-spacing 1, then span all the text blocks with a font-size .75 em ) making it really hard to 'fix'.
capnm is offline   Reply With Quote
Old 11-05-2011, 12:29 PM   #10
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
It'd be really great to have the possibility of updating the jacket with all the metadata, including tags.

Sometimes I change the tags and I would like to update the whole epub jacket without doing a conversion.
paulfiera is offline   Reply With Quote
Old 11-05-2011, 01:31 PM   #11
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,679
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Ummm... whats wrong with the add/replace metadata jacket option that is already in there?
kiwidude is offline   Reply With Quote
Old 11-05-2011, 03:17 PM   #12
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,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by kiwidude View Post
Quote:
Originally Posted by paulfiera View Post
It'd be really great to have the possibility of updating the jacket with all the metadata, including tags.

Sometimes I change the tags and I would like to update the whole epub jacket without doing a conversion.
Ummm... whats wrong with the add/replace metadata jacket option that is already in there?
Nothing, last time I used this feature it worked great.
DoctorOhh is offline   Reply With Quote
Old 11-06-2011, 06:29 AM   #13
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
Ummm... whats wrong with the add/replace metadata jacket option that is already in there?
Sorry, Kiwidude. You are absolutely right. It works perfectly. I had somehow overlooked this option.
paulfiera is offline   Reply With Quote
Old 11-06-2011, 07:47 AM   #14
SoulStyle
Enthusiast
SoulStyle began at the beginning.
 
Posts: 26
Karma: 22
Join Date: May 2011
Device: Kindle 3
Quote:
Originally Posted by Magnus View Post
I'm quite naive here... but I noticed that when I run the plugin I get:

Looking for non dc: elements in manifest
Removing child: {http://www.idpf.org/2007/opf}meta


After I've modified the ePub, the result persists when I again run the plugin. Why is that? What have I overlooked?
Happens here too. Seems to be related to the "Update metadata (including covers)" function of the Modify ePub Plug-In.

Steps to reproduce:
  1. Pick a book that surely has no "Non dc: Metadata"
  2. Do an "Update metadata (including covers)" from the Modify ePub Plug-In
  3. Scan again with "Quality Check" --> "Non dc: Metadata"
  4. Result: Book is shown as having non dc: metadata
It seems that the "Update metadata (including covers)" somehow adds the "{http://www.idpf.org/2007/opf}meta" tag, which then is identified by Quality Check.

Hope this helps
SoulStyle is offline   Reply With Quote
Old 11-06-2011, 08:27 AM   #15
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,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by SoulStyle View Post
Steps to reproduce:
  1. Pick a book that surely has no "Non dc: Metadata"
  2. Do an "Update metadata (including covers)" from the Modify ePub Plug-In
  3. Scan again with "Quality Check" --> "Non dc: Metadata"
  4. Result: Book is shown as having non dc: metadata
It seems that the "Update metadata (including covers)" somehow adds the "{http://www.idpf.org/2007/opf}meta" tag, which then is identified by Quality Check.
What is Non dc:metadata?

After I follow your steps on a book the first three lines of the content.opf file are as follows. But I get no error no matter how many times I try the above steps nor does it matter on what books I may try it on. I guess I have no books that meet the criteria needed to reproduce this error.

Code:
<?xml version="1.0"  encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="uuid_id">
  <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/"

Last edited by DoctorOhh; 11-06-2011 at 08:30 AM.
DoctorOhh is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1204 10-23-2024 01:07 PM
[GUI Plugin] Manage Series kiwidude Plugins 167 07-28-2024 03:07 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
Modify ePub plugin dev thread kiwidude Development 346 09-02-2013 05:14 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 12:57 AM.


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