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 07-03-2012, 08:20 AM   #196
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 44reader View Post
And thanks, dwanthny, for the quick answer too - even though I did realize that...
You're welcome. My point was (which you obviously realized) that you had no other choice.

I may be wrong but I believe the dialog is written that way because it means exactly what it says.

Quote:
Modify ePub modified x file(s). Proceed with updating your library?
x file(s) have been modified and are either in a temp directory or reside in memory waiting the go ahead to make the final change to your library.
DoctorOhh is offline   Reply With Quote
Old 07-03-2012, 08:43 AM   #197
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 can probably make the message a bit more explicit along the lines of what Walt has said - something like "Modify ePub has modified x file(s) into a temporary location. Proceed with replacing the versions in your library?"
kiwidude is offline   Reply With Quote
Advert
Old 07-03-2012, 08:51 AM   #198
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 kiwidude View Post
"Modify ePub has modified x file(s) into a temporary location. Proceed with replacing the versions in your library?"
Sounds great.
DoctorOhh is offline   Reply With Quote
Old 07-03-2012, 09:12 AM   #199
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
Kiwidude, can we have an option to delete @page please?
First things first - no I am not going to add an explicit option on the UI for removing @page - for all the reasons stated perfectly by Idolse.

I do agree that writing a blank @page {} section for when you have your defaults set to zero is a minor bug. I also found a bug in the existing version of the code which would cause the plugin to error - if you set your default margins to zero, and run it against an ePub which has margins specified (i.e. an epub that has been converted by calibre).

However in looking through and fixing/experimenting with all of this, I have a bigger question, which perhaps Kovid can answer.

When I set margins to zero and do a calibre conversion, calibre will write out an @page directive with margin-top: 0 and margin-bottom: 0. Now if JSWolf had his way, he doesn't want that to exist. This plugin behaves differently to calibre - if a margin is set to zero, it does not write any style attribute out for it - i.e. rather than writing "margin-top: 0" it will omit the margin-top atribute from that style. With my fixes/enhancements then if the style declaration has no other attributes then the style itself gets deleted, and if the css file has no other styles then the css file gets deleted and any links removed to it from other files. Which negates the need for any special "Remove @page" type of option completely.

However my big question is whether that the right thing to be doing? It is my understanding of the html standard that it is possible for a *browser* to enforce margins on a document. Does such a thing exist in the ePub reader world? The advantage of what Kovid's conversion logic does is that it ensures that the browser margins if they exist will get override to be zero. If you instead omit the margin-top: 0, then according to the standard the document will inherit the "browser's" top margin.

My concern is that if we continue the "zero margins means make sure no attribute in the style for it" approach then it actually becomes counter-productive and the users end up with a bigger margin that they can't control?

I don't care about cosmetic reasons on whether an @page directive does or does not exist in the css file. However I am *very* interested in the implications of a zero margin versus an unspecified margin in an @page directive. Thoughts?
kiwidude is offline   Reply With Quote
Old 07-03-2012, 09:20 AM   #200
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
In calibre if you set the margins to less than zero then no @page is written out.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-03-2012, 09:35 AM   #201
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... *less* than zero is the trick, thanks, that now makes sense.

I think this plugin should follow along those same lines then. If your defaults are set to less than zero, then it will do its *current* behaviour of omitting attributes from the style, and with my fixes propagate that to removing the style if it has no other attribution, then the css file if it has no other styles. So with the new version JSWolf should just be able to run the plugin again against your epubs and have all the stuff you don't like disappear. Note however if the @page or body style has other attributes set on it (like padding for instance) it will stay in the css file with just those attributes, just like it does today.

If you set your calibre margin defaults to either zero or a positive value, then the plugin will *always* write out that value, which is different to how it behaves today but inline with what a calibre conversion does.

Hopefully that is the right middle ground on this.
kiwidude is offline   Reply With Quote
Old 07-03-2012, 10:40 AM   #202
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,660
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
Ahhh... *less* than zero is the trick, thanks, that now makes sense.

I think this plugin should follow along those same lines then. If your defaults are set to less than zero, then it will do its *current* behaviour of omitting attributes from the style, and with my fixes propagate that to removing the style if it has no other attribution, then the css file if it has no other styles. So with the new version JSWolf should just be able to run the plugin again against your epubs and have all the stuff you don't like disappear. Note however if the @page or body style has other attributes set on it (like padding for instance) it will stay in the css file with just those attributes, just like it does today.

If you set your calibre margin defaults to either zero or a positive value, then the plugin will *always* write out that value, which is different to how it behaves today but inline with what a calibre conversion does.

Hopefully that is the right middle ground on this.
Let me get this straight. If I set to no margins, then the plugin will (in a future version) delete the @page. Is this correct?

Can we please have the @page and the body dealt with separately? While yes, I want the @page changed, I may not want the body style changed.
JSWolf is offline   Reply With Quote
Old 07-03-2012, 10:52 AM   #203
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 JSWolf View Post
Let me get this straight. If I set to no margins, then the plugin will (in a future version) delete the @page. Is this correct?

Can we please have the @page and the body dealt with separately? While yes, I want the @page changed, I may not want the body style changed.
If you set NO (page) margins you will get a @page

If you set a Negative page margin, you get NO @page
theducks is offline   Reply With Quote
Old 07-03-2012, 10:58 AM   #204
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,660
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 theducks View Post
If you set NO (page) margins you will get a @page

If you set a Negative page margin, you get NO @page
I have all of the margins now set to -.1 pt. That should do it when the plugin gets updated.
JSWolf is offline   Reply With Quote
Old 07-03-2012, 12:21 PM   #205
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
@JSWolf - in the gui if you use the spin up/down buttons to set your defaults, if you go one less than 0.0 it will say "No margin" (under the covers calibre stores that as -1.0). As far as this plugin will be concerned any negative value will be fine.
kiwidude is offline   Reply With Quote
Old 07-03-2012, 12:38 PM   #206
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,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I just found a bug in the plugin. I had the Remove unused image files checked and it removed the cover image. Yes, the cover image is used.

See PM for a link to the book that shows the problem.

Last edited by JSWolf; 07-03-2012 at 12:41 PM.
JSWolf is offline   Reply With Quote
Old 07-03-2012, 01:57 PM   #207
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
Beta for v1.2.8

@JSWolf - nice find and thanks for the PM. The issue is caused by there being multiple children in that svg container area of the xhtml page. I'm including the fix in this attachment.

To anyone - can someone please have a quick sanity check of the attachment to make sure you are happy with the changes made to the margins handling. As noted it still does not do anything about margins for named body classes, but all the other behaviour discussed recently should be in place.

@diapdealer - I haven't forgotten your @import url() thing for xpgt files, but it is a non-trivial change that I will put in a following release, given the bug just found in remove unused images I want this version out there asap.

Last edited by kiwidude; 07-04-2012 at 02:51 PM.
kiwidude is offline   Reply With Quote
Old 07-03-2012, 02:12 PM   #208
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,660
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
@JSWolf - nice find and thanks for the PM. The issue is caused by there being multiple children in that svg container area of the xhtml page. I'm including the fix in this attachment.

To anyone - can someone please have a quick sanity check of the attachment to make sure you are happy with the changes made to the margins handling. As noted it still does not do anything about margins for named body classes, but all the other behaviour discussed recently should be in place.
Yes, it worked. It did not delete the cover image but did correctly delete the cover thumbnail. Now, when a cover thumbnail exists, does the plugin delete it if it is not used in any of the XML files and if it does, does it also get rid of any spine entries for it? That would be a good thing. If it's not used in any XML, then it's not needed even in the spine.

As for the @page, it seems to be working now. So we can add or remove as desired based on the margin settings. This work well.
JSWolf is offline   Reply With Quote
Old 07-03-2012, 02:29 PM   #209
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by kiwidude
@diapdealer - I haven't forgotten your @import url() thing for xpgt files, but it is a non-trivial change that I will put in a following release, given the bug just found in remove unused images I want this version out there asap.
Not a problem in the least. It was just something I noticed that is basically cosmetic anyway.
DiapDealer is offline   Reply With Quote
Old 07-03-2012, 02:30 PM   #210
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
@JSWolf - Yes it considers all images for deletion, yes as you found in the epub you sent me thumbnails if not referenced anywhere will also get deleted, and yes if it decides an image is unused it removes all references to it from the manifest, be it items, spine or guide. Glad to hear the margins stuff is working well too.
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 03:23 AM.


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