Cover image not resizing

3 posts / 0 new
Last post

I have two problems - the first is that the cover image doesn't resize from an unzipped epub and the other is that the cover image doesn't display at all from a zipped epub.

I know nothing but :-

<svg xmlns="" xmlns:xlink="" version="1.1" width="100%" height="100%" viewBox="0 0 564 751" preserveAspectRatio="none">

I wondered if this preserveAspectRatio=none could be the problem.

I can't find how it gets there to try and change it and I don't even know where to start looking for the cover image from the zipped ebook.

As much detail as you have time to give would be very much appreciated.


Sorry - forgot to mention using embed.html from the latest zip file from github.

Hmmm - basically Readium only has a meaningful presentation of SVG images for my books, if it is the cover image ;o) Usually within other content documents Readium disperses images, raster or vector over different pages, therefore no useful program at all for the audience for books containing images ;o)
Therefore this is surprising.
But you provided only the start tag of the svg element, not the complete image, therefore the
problem can be within the rest of the SVG document. Maybe for testing you can
a) test it standalone outside the EPUB with a normal browser/viewer
b) after adding a Doctype you can check it with the W3C validator

preserveAspectRatio="none" should only have the effect, that the horizontal and vertical scaling happens independently to adjust the viewBox area to the available viewport always completely.
Typically the effect is only some simple distortion of the image.
Because for width and height of the root svg 100% is the default value, there is no need to
note this, but this causes no difference in presentation.

To find the cover image, you have to unzip you book and you have to look into the OPF-document to see, which document is used as the cover image (different methods for EPUB 2 and 3). The behaviour may depend on how the SVG is used - in EPUB 2 obviously embedded in an XHTML document, for EPUB 3 there is as well an SVG document possible.
Obviously if the SVG is embedded in XHTML, the appearance of the cover depends on other issues than SVG, maybe there is some CSS styling as well applicable.

Secondary menu