Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 09-21-2022, 07:41 PM   #1
LastSilmaril
Enthusiast
LastSilmaril began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Oct 2011
Device: PW2 3G, KV 3G
Generated column width in paged mode extremely narrow if font-size: 0;

I just got a book with a series of images at the beginning that showed up as postage-stamp size in the bundled viewer when in paged mode, but OK in other clients and in the viewer when in continuous mode. Some investigation with the viewer's built-in inspector showed that the generated column-width of the iframe was some extremely small number, like 34px instead of equivalent to the width of the viewer area.
Crucially, this did not happen for the cover or for regular text. Comparison of the cover's xhtml file with that of the subsequent images showed that the cover page's xhtml did not import any CSS, whereas the files of those images that showed up in an extremely constricted column, did.
The CSS file in question was very short:

Code:
@charset "UTF-8";

html,
body {
  margin:    0;
  padding:   0;
  font-size: 0;
}
svg {
  margin:    0;
  padding:   0;
}
After commenting out 'font-size' in the editor, saving, and reloading the book in the viewer, the images showed up normally. I am not sure what the code path is for generation of the pages in the viewer (I looked here but I'm a little lost, I'm not sure where in the codebase css generation is) but I'm assuming that the amount and size of text is taken into account, and since this page didn't have any text and the font size was so low, it decides to make the column as narrow as possible instead of letting it fill up the width of the viewer. It's trivial for me to comment out the CSS that leads the viewer down this codepath, but presumably there's a reason it was there in the first place: I don't know what changing this would do in every other viewer. If it is possible to have a more robust check when generating the column size for paged mode, that would be rather helpful for users with books that have this CSS quirk for whatever reason.


Calibre version: 6.5.0
OS: Windows 10 Pro 10.0.19044.2006 ("21H2")
The book in question is originally an AZW3 from which an EPUB was extracted with the KindleUnpack plugin. This behavior presents itself with both formats.

Cross-posted to launchpad

Last edited by LastSilmaril; 09-21-2022 at 07:42 PM. Reason: added link
LastSilmaril is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyway to change font size or margin in Reflow mode with double column? virgiliod KOReader 1 09-06-2018 12:58 PM
Narrow text width, double spacing R71986 Conversion 12 06-20-2014 12:20 PM
Is paged mode supposed to work this way? knghcm Library Management 5 03-24-2014 12:05 AM
0.8.61 Paged Mode mXb Library Management 6 07-27-2012 04:26 AM
0.8.61: E-book viewer - paged mode, I like it DrChiper Calibre 17 07-23-2012 06:44 AM


All times are GMT -4. The time now is 01:17 PM.


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