|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jan 2026
Device: Kobo Libra 2
|
Image does not appear centered in KOReader but appears centered in Calibre renderer
Good Afternoon,
I would like help formating an epub. I am not new to KOReader, but I _am_ new to manually formatting epubs with Calibre. Before I used to just use all epubs regardless of whether they were appropriately formatted, but lately I wanted to try getting some experience formatting them for them to look better. The main issue I have encountered for now is with a certain epub where an image appears centered in the Calibre renderer but not in KOReader. KOReader, if I remember correctly, uses crengine, and I assume the Calibre renderer must use something based on WebKit or something similar, so that explains the difference. However, I have yet to find a solution. The HTML body of the page concerned is below: Code:
<body class="calibre1"> <h2 class="part-number"><em>Zero</em></h2> <p class="centered-image-1"><img alt="Separator Image Missing" height="1" src="../images/line.jpg" width="84"/></p> <h2 class="part-title">7 August 1944</h2> </body></html> Code:
p.centered-image-1 {
text-align: center !important;
text-indent: 0;
margin-top: 0;
margin-bottom: 1em;
}
`img2.png` is a screenshot of KOReader's rendering. The image is the line after the header "Zero". I have yet to find a way to make the image properly center in KOReader. <br> <br> <br> Bonus question 1: Why do the same images, in different epub files but inserted with the same class, scale differently? In one epub, a width of `256` was sufficient, whereas with the other I had to change that to `512`. This difference is only present in KOReader, Calibre shows them at equal sizes when both are set to `256`. Bonus question 2: I have a publisher information page that gets rendered properly (with text centering) with Calibre but not with KOReader. `img3.png` is how it looks rendered by Calibre, `img4.png` is how it looks in KOReader. How can I make it look like on Calibre in KOReader? I know this is a lot so thank you very much for your time :) Last edited by ilikelilies; 01-09-2026 at 12:56 PM. |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,795
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
The test case as given doesn't render as in the screenshot. There's either another style in the book or a style tweak like left align most text is active (or perhaps embedded styles are disabled). Please provide a complete minimal testcase if it's not one of the latter two.
|
|
|
|
| Advert | |
|
|
![]() |
| Tags |
| calibre, centering, epub, koreader |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I get centered images using Sigil? | provlima | Sigil | 4 | 04-30-2022 11:13 AM |
| Centered initial caps? | nabsltd | ePub | 60 | 08-26-2017 09:06 AM |
| Centered but left align? | mtrahan | ePub | 15 | 04-01-2012 04:56 PM |
| would like toc to be centered | alansplace | Kindle Formats | 9 | 11-20-2011 12:47 PM |
| Calibre screwing up centered-text b/c of forced tabs | lurker316 | Calibre | 0 | 12-21-2010 10:36 PM |