|
|
#1 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2026
Device: Kindle Paperwhite
|
Image max-width imposed automatically in Calibre eBook viewer
I have converted a .pdf to an .epub which looks perfect in the Calibre eBook editor. However, when I open it in the VIEWER, each image has some max-width value imposed on it, squishing it down to some fraction of its intended width.
When I open the inspector and edit the "style" element so that max-width is set to either "none" or "100vw", the image is again correct - until I close the inspector, when it is immediately squished again. To re-iterate: the file looks fine in the editor. The images are only altered in the viewer. What is happening here, and how can I stop it? |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,152
Karma: 29626604
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
In paged mode all images have a max width otherwise they will appear cut off. Use the viewer in flow mode and you wont have that issue.
|
|
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2026
Device: Kindle Paperwhite
|
Thank you so much, Kovid - that has worked perfectly, although I really still do not understand the logic behind this.
|
|
|
|
|
|
#4 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,702
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Put the following CSS code in your ePub's CSS and you won't have a problem.
CSS Code:
img {
max-height: 100%;
max-width: 100%;
}
|
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2026
Device: Kindle Paperwhite
|
Yeah, I tried that after looking through this forum and Reddit. See attached image - is this what you mean? It does not have any effect. |
|
|
|
|
|
#6 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2026
Device: Kindle Paperwhite
|
Thank you for the response. Please see image above. Is this what you have in mind? I read similar advice on this forum and also in Reddit. Doing this, and such variants as max-width:none or max-width: 100vw had no impact. |
|
|
|
|
|
#7 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,655
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Our books are built out of boxes of text / images within bigger boxes. The Top Outermost Box is the BODY, not the viewing window The Inspector tool in the Calibre Editor, shows the current Box parameters as inherited. Every P, H#, Div has one that is the result of the CSS applied (there many more layers than just these. In many cases, some of the parameters are 0, by most usage. The Border is not visible. Margin is the most common we use. Remember, each Box, has all these. This is why, changing the viewing mode affects what you see and what CSS have control. Scroll is 1 long page (just not all visible unless you have a really TALL monitor )
|
|
|
|
|
![]() |
| Tags |
| calibre editor, html, images, inspector, max-width |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Show info about the image in popup window of image viewer when reading an ebook | codychan | Calibre | 2 | 06-04-2021 05:04 PM |
| Decreased saturation on image only in ebook-viewer | ownedbycats | Viewer | 2 | 04-25-2021 11:40 PM |
| Image resizing issues while using max-height/max-width | Detroa | ePub | 22 | 08-26-2020 06:17 PM |
| change img or box width for multi-column in calibre viewer | rjwse@aol.com | Calibre | 2 | 12-02-2019 10:48 AM |
| Max Height in Calibre Viewer | XrXca | Calibre | 3 | 03-14-2014 10:46 PM |