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 01-24-2014, 06:33 AM   #556
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Whether the ORIGINAL_EPUB is created is based on the tweak "save_original_format_when_polishing". If that is True, the current epub is copied to ORIGINAL_EPUB before making the changes.
davidfor is offline   Reply With Quote
Old 01-24-2014, 06:54 AM   #557
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by davidfor View Post
Whether the ORIGINAL_EPUB is created is based on the tweak "save_original_format_when_polishing". If that is True, the current epub is copied to ORIGINAL_EPUB before making the changes.
OK - so in the last few months I have probably destroyed a whole bunch of original-origiinal_epub backups without realising I was doing that

when was this "feature" released - maybe the damage is not as bad as I fear, if it was only recently introduced. I skimmed back through the thread & it's only 2 pages back
cybmole is offline   Reply With Quote
Old 01-24-2014, 07:32 AM   #558
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by cybmole View Post
when was this "feature" released - maybe the damage is not as bad as I fear, if it was only recently introduced. I skimmed back through the thread & it's only 2 pages back
About five months ago, at the end of August.
Rev. Bob is offline   Reply With Quote
Old 01-24-2014, 07:41 AM   #559
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,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by cybmole View Post
OK - so in the last few months I have probably destroyed a whole bunch of original-origiinal_epub backups without realising I was doing that
I don't believe any original_epub is ever overwritten. It'll take only a few minutes to prove it to yourself, so check. The original_epub is only created if one doesn't exist.

Last edited by DoctorOhh; 01-24-2014 at 07:46 AM.
DoctorOhh is offline   Reply With Quote
Old 01-24-2014, 02:02 PM   #560
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If it follows the core calibre logic (when converting and polishing) I believe the "original_epub" is used as the source for all changes, if available. So if it doesn't exist, calibre changes "epub" and backs up the original as "original_epub", but if it DOES exist, calibre uses THAT as the source for the conversion/polish, and overwrites the "epub".

Under no circumstances is "original_epub" ever supposed to get overwritten.
eschwartz is offline   Reply With Quote
Old 01-24-2014, 11:05 PM   #561
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Looking at the code again, and actually reading it, the ORIGINAL_EPUB is only created if it doesn't exist. But, I am pretty sure it is working on the current epub for the changes. The only reference to the ORIGINAL_EPUB I can find is when it is created and that is after the confirmation prompt. I just did a quick test and it is modifying the current epub, not the original.
davidfor is offline   Reply With Quote
Old 01-25-2014, 07:23 PM   #562
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,158
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Is there a way to use this plugin to completely batch replace a stylesheet in an ebook, instead of append?

I have thousands of stories and I didn't fancy updating the stylesheet.css one at a time.
Amalthia is offline   Reply With Quote
Old 01-25-2014, 08:59 PM   #563
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by davidfor View Post
Looking at the code again, and actually reading it, the ORIGINAL_EPUB is only created if it doesn't exist. But, I am pretty sure it is working on the current epub for the changes. The only reference to the ORIGINAL_EPUB I can find is when it is created and that is after the confirmation prompt. I just did a quick test and it is modifying the current epub, not the original.
Well, it's possible that is what calibre itself does, but to be honest, it was a little confusing to me. All I could really determine was that original_epub should get created as a backup of the original state of the book, no matter what else. Unless you disable it via preferences.
eschwartz is offline   Reply With Quote
Old 02-12-2014, 06:47 AM   #564
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Question

Quote:
Originally Posted by eschwartz View Post
Well, it's possible that is what calibre itself does, but to be honest, it was a little confusing to me. All I could really determine was that original_epub should get created as a backup of the original state of the book, no matter what else. Unless you disable it via preferences.
back to this issue.
I'd followed advice given and turned OFF the create/ override of original_epub when tweksing . polishing
I'd tested & it was working

as at v 1.23 it has been turned back ON in my preferences & I did not do it.

i.e. I had set
save_original_format_when_polishing = False
it had silently changed back to
save_original_format_when_polishing = True

so who / when / how ?

AM I going to have to check & re-test after every calibre update ?


or Iha I somehow not made that change STICK ?

Hmm- I change trus to false, like so
# Save original file when converting/polishing from same format to same format

save_original_format = True

save_original_format_when_polishing = False

I click apply at bottom of window, then I click apply at top left, and I get this:
calibre, version 1.23.0
ERROR: Invalid tweaks: The tweaks you entered are invalid, try resetting the tweaks to default and changing them one by one until you find the invalid setting.

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\tweaks.py", line 421, in commit
File "<string>", line 623
Qt = <class 'PyQt4.QtCore.Qt'>
^
SyntaxError: invalid syntax

it seems that those 2 tweak value cannot be edited at all. restore defaults works, overwriting True with True , for either field gives the above error ??? so it's not really a syntax error, I am not changing anything???

Last edited by cybmole; 02-12-2014 at 07:02 AM.
cybmole is offline   Reply With Quote
Old 02-12-2014, 06:55 AM   #565
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
repeating the is - original_epub overwritten test.
I am using this preference
save_original_format_when_polishing = True
I have chosen a book in my library for which the epub & the original epub file dates are both 10/1/13
I am now runniing modify epub....
epub file date changes to today
original epub date not changed - so I was wrong about that, and my original originals are all still intact, I think!

Last edited by cybmole; 02-12-2014 at 07:04 AM.
cybmole is offline   Reply With Quote
Old 02-16-2014, 05:59 AM   #566
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,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@cybmole - this plugin will *never* overwrite an existing "ORIGINAL_EPUB".

The logic in this plugin is very simple when that "save_original_format_when_polishing" is set to true:

- If you have an EPUB but no ORIGINAL_EPUB, then it will effectively copy the current EPUB to "ORIGINAL_EPUB", *before* doing any Modify operations on the EPUB.
- If have an ORIGINAL_EPUB but no EPUB, then it will do nothing.
- If you have an EPUB and already an ORIGINAL_EPUB, then it just works on the EPUB.

So operations are always and only ever on the EPUB format. If you do multiple Modify operations, they will progressively get applied to that EPUB version. The plugin never takes the ORIGINAL_EPUB as a starting point for operations. If you want to do that you have to use the conventional "Restore" feature that calibre has to overwrite your EPUB from the ORIGINAL, and then do your Modify actions again which will apply to your EPUB format.
kiwidude is offline   Reply With Quote
Old 02-16-2014, 06:21 AM   #567
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
that is comforting, thanks & I've proved it with my own tests also, Somehow, earlier in the thread I got the idea that is was overwriting - maybe someone else posted to say that's what it did & I assumed they were correct.
cybmole is offline   Reply With Quote
Old 02-19-2014, 03:20 PM   #568
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
new reader - new challenge.
to get the most out of my new Kobo aura HD reader, it seems I need to retrospectively strip all
font-family: xxxxxxxxxxx;
lines from my books CSS.
I've been merrily doing the opposite of that, and adding an explicit
p { font-family: "Times New Roman", Times, serif;}
via append css for some time now
So has a "remove CSS" type feature ever been requested, either within the plug in or within the main calibre convert settings
I suppose I can construct a find + replace regex but I'd prefer not to have to reconvert books if there is an easier way
I think I'd need to find font-family(.*);
replace with nothing
and hope that there are no instances that don't have a trailing ;
or can I append a "null" setting that will act as an overwrite. is there such a command as font-family:[empty]; ?
UPDATE:
I see that I can set a filter within calibre convert options that will remove font family, but an initial test shows that that filer setting is not picked up and applied by the plug-in. The plug-in only picks up extra css to append, not filters to apply ?

Last edited by cybmole; 02-19-2014 at 03:31 PM.
cybmole is offline   Reply With Quote
Old 02-20-2014, 06:05 AM   #569
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by cybmole View Post
or can I append a "null" setting that will act as an overwrite. is there such a command as font-family:[empty]; ?
You could append p {font-family: inherit} which should override the previous font-family setting and do the same thing as if there had been no font-family property defined at all.
GeoffR is offline   Reply With Quote
Old 03-29-2014, 09:36 AM   #570
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
I have an idea for an added extra feature...

Seeing as quite a few e-readers now allow a user to load their own fonts onto a device, would it be possible to have an added css feature, when stripping embedded fonts to allow instead of stripping the references to those fonts have the src point to a device resource font instead.
- could possibly have a list of fonts which would be redirected
- would have to probably have a text box with a 'device font path', which would be up to user to make sure that it is correct.

The main reason I ask, is that I have a lot of epubs with several common fonts (Charis being main one) and would like to reduce the size footprint of the epubs, but not have to miss the correct fonts being used.

What do you think?
Perkin 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 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[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 08:08 AM.


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