epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Images Cut-Off on Small Screens...

Open jbhorsewriter7 opened this issue 11 years ago • 6 comments

When I have images in an epub file they are getting cut off on the right side if my screen is very small.

(It looks like the images are a little wider than the page - with only a max-height being set.)

I have tried adding a max-width of 100% and this seems to fix the issue... is this something to add to the image styles?

jbhorsewriter7 avatar Dec 02 '15 15:12 jbhorsewriter7

use smartimages.js

grovertb avatar Dec 02 '15 16:12 grovertb

I included the file... nothing is different. Is there something else I should be doing?

I am using the reader file.

jbhorsewriter7 avatar Dec 02 '15 16:12 jbhorsewriter7

the link of your page to see your viewfinder? and help test

grovertb avatar Dec 04 '15 15:12 grovertb

I think the easiest way would be to add a extra stylesheet for the iframe

/* We need to set a height/width for the iframe to render at correct size on mobile divices */
reader = ePubReader(url,{
  width: parseInt(window.getComputedStyle(document.getElementById('viewer')).width), 
  height: parseInt(window.getComputedStyle(document.getElementById('viewer')).height)
});

/* Add a extra css to the reader iframe */
reader.book.addHeadTag('link', {'rel':'stylesheet', 'href':'css/reader.css'});

And in this reader.css:

img {
    max-width: 100%;
    height: auto !important;
}

gerhardsletten avatar Jan 19 '16 14:01 gerhardsletten

That's basically what I did... I don't know if they are planning to make any changes to the actual library.

jbhorsewriter7 avatar Jan 19 '16 21:01 jbhorsewriter7

Images are still not rendering properly in epub3. How should we fix it ?

mithunmo avatar Apr 16 '19 17:04 mithunmo