![]() |
Calibre is not resizing images
For some reason Calibre isn't resizing my images when I convert a .docx to an epub format. All of the forums that I find say it will automatically resize, but I've tried .png .jpg and .svg versions of the same image and they haven't been resizing. Instead they appear off the page. This doesn't really help, considering the main problem-image is a map.
The images will resize on an iPhone, iPad and MacOS iBooks, but not a Kobo ereader, even though the output type is set to Kobo. My book is a novel with only black and white images and reflowable text. Help would be appreciated! |
Quote:
First of all don't set the output type to "Kobo", because this refers to the original ancient Kobo devices that had extremely low resolution screens. Instead use "Tablet" so that the image file doesn't get resized. Second, you will usually need to edit the CSS or HTML styles so that the image displays at the size you want. E.g. if you want a map to fill the avaliable screen (i.e. changing the aspect ratio to match the available screen) then use height:100%; width:100%; for the img object. Or if you want to display the image as large as will fit on the screen but retaining the original aspect ratio then use height:100%; width:auto; max-width:100%; for images with a taller aspect ratio than the screen, or height:auto; max-height:100%; width:100%; for images with a wider aspect ratio than the screen. Alternatively you can use <svg> styles to resize the image which gives more control than <img>. (If you don't care about the aspect ratio and the only problem is that the images are too big for the screen then you might get away with just adding img {max-height:100%; max-width:100%;} to the book's stylesheet.) |
I asked more or less the same question
https://www.mobileread.com/forums/sh...d.php?t=313771 tldr: Try setting the output profile to tablet. It's work. |
Thanks so much for the reply! It's my first self-published eBook and I'd like to get everything right.
I put the style code into Look at Feel > Styling: img {max-height:100%; max-width:100%;} I also put it into tablet export (so much nicer, thanks for that tip). However the image is still going off the page vertically. It seems to fit horizontally but not vertically now. It it maybe not possible to win both? |
Quote:
Here is a simple example of styles for a full-page image using <img>: stylesheet.css: Code:
body.full-page-image { margin:0; padding:0; }Code:
<?xml version='1.0' encoding='utf-8'?> |
Thank you very much for helping me figure out which direction to go! I'll focus on the epub rather than Calibre.
Thanks again! |
Quote:
Quote:
|
Quote:
Convert your single line showing the map: Code:
<p class="block_15" id="calibre_pb_3"><img src="images/Southern_Elabrium_map_eBook.jpeg" alt="Image" class="calibre6"/></p>Code:
<div class="full-page-image">Personally, I prefer to use an svg wrapper for full screen images. Code:
<style type="text/css">Code:
.nomargin {Change the height/width in both places to match your image and it will be fitted to the full screen. And yes, the multiple margin and padding settings are redundant but they work around some oddities in epubs I've edited. |
| All times are GMT -4. The time now is 05:37 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.