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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-04-2012, 05:48 AM   #76
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Ok, new version of the Modify ePub beta and screenshot posted above. I'll sort out a new QC as well with that single menu option.
kiwidude is offline   Reply With Quote
Old 05-04-2012, 08:16 AM   #77
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: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
Ok, new version of the Modify ePub beta and screenshot posted above. I'll sort out a new QC as well with that single menu option.
Thanks, kiwidude.

I'm using the new beta and checking "Remove embedded fonts" doesn't seem to remove @font-face declarations if the embedded fonts are not found.

This happens with epubs where the embedded fonts where removed sometime ago but where the @font-face declarations still exist.

I am not sure if that is the issue. Also running it with an epub containing Adobe files, I gte the popup "No epub files where updated"

Last edited by paulfiera; 05-04-2012 at 08:18 AM.
paulfiera is offline   Reply With Quote
Advert
Old 05-04-2012, 10:47 AM   #78
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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Gee, I seem to be the dissenter here

Cases (some inter-dependent), with proposed actions;

1: @font found in HTML pages
1a: discard
1b: Move to (specified) CSS (Link updated if to a new CSS)


2: @font in one or more CSS
2a: @font with no font-family usage of said font; Delete entry
2b: @font with embedded fonts; keep or Delete both
2c: @font (assumes device supports) without embedded ; Warn or delete

3: (bogus) font files without an @font; delete


4: font-family calls to a Font face (other than (Generic) serif or sans-serif) without a SET of @font (Normal, Bold, Italic, Italic-Bold) statements; Warn if missing (what do you do about never used face versions)

I do use 2b and 2c @font usage on occasion .
1b would be my choice for those that do not violate 2a
theducks is offline   Reply With Quote
Old 05-04-2012, 11:03 AM   #79
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
I've attached a new beta of the plugin to the previous post. So that should fix the issue @paulfiera found above. It also has a change to the regex to strip more whitespace for @font-face - let me know how that goes...

@theducks - I don't really see you as a dissenter - rather just wanting to expand the scope of the feature . As implemented it is completely and totally aimed at people who want to obliterate @font-face definitions in entirety. You have a far more granular list - in which case this feature is just not going to be for you
kiwidude is offline   Reply With Quote
Old 05-04-2012, 11:09 AM   #80
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: 29,689
Karma: 54369090
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 kiwidude View Post
You have a far more granular list - in which case this feature is just not going to be for you


I would not use some of those list items , I just tried to make the list complete for those that might

I like pretty books (some font variation and embellishment) and hate bloat caused by poor or redundant (that should have been put in the CSS) coding.

Thanks for putting up with my rants
theducks is offline   Reply With Quote
Advert
Old 05-04-2012, 11:51 AM   #81
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: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
I've attached a new beta of the plugin to the previous post. So that should fix the issue @paulfiera found above. It also has a change to the regex to strip more whitespace for @font-face - let me know how that goes...
The latest beta is working perfectly. It also trims the whitespace left over after cleaning font declarations from MS Word's converted epubs as mentioned by jackie_w

Kudos, kiwidude.
paulfiera is offline   Reply With Quote
Old 05-04-2012, 07:22 PM   #82
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.0 Released

Changes in this release:
  • Move the "Remove margins from Adobe .xpgt files" into a new Adobe section on the UI
  • Add a "Remove Adobe .xpgt files and links" option for complete clean xpgt file removal
  • Add a "Remove Adobe resource DRM meta tags" option for stripping DRM <meta> resource identifiers from xhtml content.
  • Extend "Remove embedded fonts" to also remove @font-face declarations from the CSS and html files
  • Add a "Remove unused image files" option to remove orphaned images not referenced from the html content to save space.
  • Add a "Flatten TOC hierarchy in NCX file" option to move all the navPoints to a single level if they are nested.

Thanks to all those who tested the beta versions. I'm still intending to add cover insert/update in the very near future but in case that takes longer than I hope I'm releasing this version as is.

If in doubt as to what the things above "mean" (and when you might use them), please refer firstly to the Help file with the plugin and secondly to the recent posts above in this thread. A new version of Quality Check was released earlier tonight to partner this.
kiwidude is offline   Reply With Quote
Old 05-05-2012, 09:06 AM   #83
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: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Fantastic, kiwidude. Working great.

One word of caution about removing unused images files: Sometimes, the image files have spaces in there file names:

Code:
"../Images/Deliver Us From Evil Photos_Page_09.jpg"
but when they are referenced in the html files, their names are encoded:

Code:
"../Images/Deliver%20Us%20From%20Evil%20Photos_Page_09.jpg"
I tested the plugin with an epub with this characteristics and the images where removed, even though they are actually used in the epub. I had made a backup of the epub before though.

I guess this applies to the QC plugin too.

Many thanks!
paulfiera is offline   Reply With Quote
Old 05-05-2012, 09:24 AM   #84
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Ahhh - good spot. I'll sort that out now.
kiwidude is offline   Reply With Quote
Old 05-05-2012, 11:35 AM   #85
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.1 Released

Changes in this release:
  • Fix for remove unused images to url encode image paths with spaces in them, and handle namespaced images
kiwidude is offline   Reply With Quote
Old 05-05-2012, 10:32 PM   #86
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by kiwidude View Post
That is exactly the ethos of this plugin. It does not use any of calibre's conversion pipeline code, nor does it do any css or html parsing/rewriting.

So if you choose the xpgt files & links option for example, the only change that should be made is to the opf file to remove the reference to the xpgt, the xpgt file itself will be deleted, and then on each html page that had a <link .../> it will do a simple raw text regex based replacement of just that.
Since it does not rely on Calibre's conversion code to do this, I will have to give this plugin a try and see how it goes. Well done for not having Calibre remake the ePub.
JSWolf is online now   Reply With Quote
Old 05-05-2012, 10:34 PM   #87
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
My 2p's worth... epubs with embedded fonts should also have @font-faces (in either css or html). Other epubs will have @font-faces (in either css or html), but no embedded font files, i.e. referencing external font files. I would be happy to have a single 'Remove embedded fonts' option which handles both scenarios. I don't need to know which scenario was found, I just want it all gone.
But, the way I embed fonts now, I use serif for the main body font so even if there is an embedded font, you can still change the font as wanted.
JSWolf is online now   Reply With Quote
Old 05-06-2012, 03:48 AM   #88
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by JSWolf View Post
Since it does not rely on Calibre's conversion code to do this, I will have to give this plugin a try and see how it goes. Well done for not having Calibre remake the ePub.
Another way of thinking about it is that our original idea was that this plugin might partner the Tweak ePub feature of calibre. It is supposed to represent an automation of keystrokes and thought processes you would normally have to do in notepad or whatever text editor you use. Just without you having to repetitively open all the necessary files and think your way around the changes or get lazy or careless and make mistakes or leave cruft in the ePub.

The only calibre code it uses of note is if you tick the Update Metadata feature, which calls the same exact code as gets called when you Save to Disk or Send to Device from calibre. So this does inserting or updating metadata into the opf file, and attempting to update the cover image if it can easily do so like if previously converted If you are the sort of person wanting to keep your epubs closer to virginal state you will probably want to avoid that, even though as I say the net effect is no different to if you export using calibre.
kiwidude is offline   Reply With Quote
Old 05-06-2012, 04:08 AM   #89
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by kiwidude View Post
Another way of thinking about it is that our original idea was that this plugin might partner the Tweak ePub feature of calibre. It is supposed to represent an automation of keystrokes and thought processes you would normally have to do in notepad or whatever text editor you use. Just without you having to repetitively open all the necessary files and think your way around the changes or get lazy or careless and make mistakes or leave cruft in the ePub.

The only calibre code it uses of note is if you tick the Update Metadata feature, which calls the same exact code as gets called when you Save to Disk or Send to Device from calibre. So this does inserting or updating metadata into the opf file, and attempting to update the cover image if it can easily do so like if previously converted If you are the sort of person wanting to keep your epubs closer to virginal state you will probably want to avoid that, even though as I say the net effect is no different to if you export using calibre.
I do like to keep my code as clean as possible. But I can live with the metadata added to the OPF as that is easily removable should I ever want to. Plus, it's not really changing any of the code. Then thing though is why update the ePub's OPF when there is another OPF that could be used to put those changes in?
JSWolf is online now   Reply With Quote
Old 05-06-2012, 04:20 AM   #90
kiwidude
calibre/Sigil 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,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by JSWolf View Post
I do like to keep my code as clean as possible. But I can live with the metadata added to the OPF as that is easily removable should I ever want to. Plus, it's not really changing any of the code. Then thing though is why update the ePub's OPF when there is another OPF that could be used to put those changes in?
The remove non dc: metadata option will remove all the calibre specific metadata cruft along with any from other tools like Sigil. As stated elsewhere in this thread it is almost mutually exclusive with the update metadata option, since the latter always runs last. But as you say it does no harm for most users, it is only those who are submitting their books for publication and get blocked by tools those sites have to reject epubs with cruft in them that will care.

Not sure what you mean by the second comment. Do you mean why update the internal ePub opf file when calibres library has an opf file too? If so the answer is that if you open the book using calibres viewer, it only uses what is internal to the ePub. So the title, author in the window title and opening cover might not match what your library have displayed in calibre. So people who actually read their books on the computer using the calibre viewer, or who do direct things with the calibre file system (which we know they shouldn't but people still do) rather than using calibres export features have a way of getting the ePub internally correct without having to do an ePub -> conversion.
kiwidude is offline   Reply With Quote
Reply

Tags
modify epub

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1171 03-23-2024 05:18 AM
[GUI Plugin] Open With kiwidude Plugins 402 03-16-2024 11:44 PM
[GUI Plugin] Manage Series kiwidude Plugins 166 02-13-2024 11:31 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 01:26 PM.


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