Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-09-2026, 12:54 PM   #1
ilikelilies
Junior Member
ilikelilies began at the beginning.
 
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>
The `centered-image-1` class is as follows:

Code:
p.centered-image-1 {
  text-align: center !important;
  text-indent: 0;
  margin-top: 0;
  margin-bottom: 1em;
}
`img1.png` is a screenshot of the Calibre renderer's output.

`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 :)
Attached Thumbnails
Click image for larger version

Name:	img1.png
Views:	12
Size:	9.2 KB
ID:	220157   Click image for larger version

Name:	img2.png
Views:	13
Size:	16.8 KB
ID:	220158   Click image for larger version

Name:	img3.png
Views:	17
Size:	68.4 KB
ID:	220159   Click image for larger version

Name:	img4.png
Views:	15
Size:	117.9 KB
ID:	220161  

Last edited by ilikelilies; 01-09-2026 at 12:56 PM.
ilikelilies is offline   Reply With Quote
Old Today, 03:27 PM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2026-01-11_20-23-27.png
Views:	3
Size:	45.6 KB
ID:	220247  
Frenzie is offline   Reply With Quote
Advert
Reply

Tags
calibre, centering, epub, koreader


Forum Jump

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


All times are GMT -4. The time now is 11:10 PM.


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