05-03-2012, 03:21 AM | #211 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
That would be great. You could even set it as an option.
And now that I have you here... Could you do something about this? Basically, some epubs have the cover page in, say..."OEBPS/cover.html". When converting, this page is usually removed and the cover is placed in "Text/titlepage.xhtml", but this change is not reflected in toc.ncx, where it still points to the old non-existent file. I usually open the converted epubs in Sigil and update the TOC but I was wondering if this could be somehow automated in the conversion process. Ah, and set its playOrder to 0 or 1. Some epubs place the cover as the last playOrder number, resulting - at least in iBooks - in the cover not opening when you first open the epub. I really don't know why some epub publishers think the cover is the last thing you need to see when you open an epub. I believe it should be the first. |
05-03-2012, 04:13 AM | #212 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@kiwidude: In that scenario, a single stylesheet will work. However, I am not going to accept an option for this. The correct solution, as I described before, is to put the rules into external stylesheets and link to them from the individual html files. A patch that does that, I will accept.
@paulfiera: Open a bug report for your issue, or it will get lost, I dont have the time to look into it right now. |
Advert | |
|
05-03-2012, 04:22 AM | #213 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
05-03-2012, 07:03 AM | #214 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Hi Kovid - ok, I guess I still don't see how that stylesheet thing might work, please bear with me as I get up to speed on this.
Take for instance the epub that is on this thread here at MobileRead by JSWolf: https://www.mobileread.com/forums/sho...d.php?t=177182 It has embedded fonts, a single stylesheet, and @font-face declarations in that single stylesheet. It clearly was converted by calibre to epub at one point, and then the embedded fonts and declarations were done afterwards, quite possibly with Sigil by the looks of the metadata. So we are starting with a "perfect" epub - it has font-face declarations in a stylesheet, that is referenced from every html page. So if I do an epub->epub conversion on that with calibre currently, the @font-face declarations now get moved into every single html file except the titlepage.xhtml (along with copying the page margins, which I know cause similar angst to some people). In our "ideal" world, that wouldn't happen. Since you don't want an option to turn that off, you suggest instead a stylesheet referenced from every page. But there is already exactly just that? So what is the difference? Does it have to be *another* stylesheet? With special naming or something? |
05-03-2012, 07:11 AM | #215 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes it needs to be another stylesheet(s). You will want to collect all the different sets of font-face/page margin rules. Create new styleseets for every distinct set and then link to the appropriate stylesheet in every html file. Look at stylizer.py and flatcss.py, where all the stylesheet processing is done.
In your case that will mean one extra stylesheet in the resulting epub. For more complex books it will result in upto n+1 stylesheets where n is the number of html files. Last edited by kovidgoyal; 05-03-2012 at 07:13 AM. |
Advert | |
|
05-03-2012, 07:28 AM | #216 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Never mind
|
05-03-2012, 08:06 AM | #217 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Moderator Notice I moved all these recent posts back to this dev thread for the plugin since we are diverging into a few different subtopics. @Kovid - thx again for that info. I'm not promising I have the capability to implement it of course but I will take a look at these files. I know next to nothing about calibre's conversion code/pipeline so rather a curve in there... what could possibly go wrong... I took a read over this thread and I see much of these issues came up a year ago (fonts, margins etc) so perhaps it is time to try to do something about it. |
05-03-2012, 08:09 AM | #218 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you get stuck, feel free to ask, preferably by email.
|
05-03-2012, 08:12 AM | #219 | |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
My only concern with SVG is pure ignorance over exactly what it is and why you would want it . Kovid subsequently gave some info on this in that it allows full screen covers, and from reading around it seems that some devices don't support svg so hence there is an option to generate a simple image in a div tag instead. I want to avoid having the Modify ePub dialog having loads of "suboptions" related to specific features. Perhaps I can follow Idolse's approach (I think) he took for page margins of getting the conversion default settings to decide whether to write out an svg cover or not. Last edited by kiwidude; 07-19-2012 at 01:50 PM. |
|
05-03-2012, 03:29 PM | #220 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@kiwidude,
I'm a regular user of ePubFixer. Just in case it helps I've attached a before-and-after version of the cover xhtml file. The 'before' is from a retail epub which has not been calibre converted. The 'after' example is following use of the ePubFixer 'Edit Cover' option with 'Preserve Aspect Ratio' unchecked. If it had been checked the only difference would have been Code:
preserveAspectRatio="xMidYMid meet" Code:
preserveAspectRatio="none" Spoiler:
After Spoiler:
(I've deliberately obliterated the 'urn:uuid:' code in case it revealed personal stuff???) |
05-03-2012, 04:23 PM | #221 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Thanks very much for that Jackie. And yeah that decision on preserve ratio or not is another of the settings that I hope I can grab from calibre's default conversion options rather than have to replicate onto this plugin UI.
|
05-03-2012, 09:13 PM | #222 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
IMHO, I'd prefer to have the aspect ratio kept with no option not to keep it. Those 510x680 resolution covers bother me because they aren't aspect correct.
|
05-04-2012, 01:54 AM | #223 | |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
|
|
05-04-2012, 02:02 AM | #224 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
05-04-2012, 02:21 AM | #225 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thanks! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any web-to-epub plugin for internet browser? | bthoven | ePub | 7 | 07-10-2011 05:14 AM |
[Old Thread] Reading epub on viewer inexplicably changes the time stamp of epub | greenapple | Library Management | 20 | 03-19-2011 10:18 PM |
Easy way to modify thread subscription emails in bulk? | snipenekkid | Feedback | 11 | 02-06-2011 03:47 AM |
Another plugin dev question | DiapDealer | Plugins | 2 | 12-11-2010 01:46 PM |
Epub plugin dev | DiapDealer | Plugins | 15 | 11-12-2010 09:36 AM |