View Single Post
Old 06-10-2025, 05:07 PM   #18
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,830
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by JSWolf View Post
It's not a bug in ADE 2/3. They both work with SVG and they both work with the code I posted for a full screen image.
It works because of the bug. If ADE were going to honor % height as expected, images in ADE would look as in Webkit/Readium ereaders. Your code only will work under ADE and with ereaders based on ADE.

Quote:
In previous versions of calibre and Sigil, they did display % correctly. But that was until a change in QT quashed that. So we just have to see the images not correct in the previewers. But it does work properly in ADE 2/3, calibre viewer, Kindle with KF8, Kobo with ePub & KePub.
But it doesn't work on Sigil, Calibre, Readium, BibiReader, JSReader, Thorium, Kobo for Android and iOS, PocketBook, Lithium, Reasily, Cantook, Aldiko, Infinity Reader, BlueFire; your code will practically not work on any Android e-reader.

BUT IF YOU HAD READ THE ARTICLE, then you would know that what you're calling a bug isn't one, and that the correct way to deal with percentage heights is to include the following in the stylesheet:

Code:
html, body {
    height: 100%;
}
Alternatively, you also have the option to set the height of whatever twice: once in "%" and once in "vh"; like this:

Code:
.myFullHeight {
    height: 100%; /* ADE will work with this and will work because of the ADE's bug */
}

@supports (height: 99vh) { /* and QT ereader will use this; ADE will ignore this statement */
   .myFullHeight {
       height: 99vh;
    }
}
However, even though you can set a height of 100%, your code has the problem that the image width can be greater than 100%. If you set it to width: 100%, the image will be distorted. You can check that by opening the following epub anywhere and changing the width of the ereader window. By employing an svg wrapper that problem doesn't appear.

Click image for larger version

Name:	One1.jpg
Views:	20
Size:	29.9 KB
ID:	216143 Click image for larger version

Name:	One2.jpg
Views:	20
Size:	57.0 KB
ID:	216144
Temporal.epub

The same problem occurs when setting the height using the alternative method (see the following epub):
Temporal2.epub

But by employing a svg wrapper all problems disappear:
Click image for larger version

Name:	One4.jpg
Views:	19
Size:	20.8 KB
ID:	216147 Click image for larger version

Name:	One3.jpg
Views:	21
Size:	52.2 KB
ID:	216146
Temporal3.epub

Of course, you're free to continue using your own code (even if it's not the best), but you're leaving out more than half of e-readers.

Last edited by RbnJrg; 06-10-2025 at 05:37 PM.
RbnJrg is offline   Reply With Quote