Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 07:09 PM   #1
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
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?
aunk05 is offline   Reply With Quote
Old Yesterday, 10:44 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old Today, 04:49 AM   #3
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
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.
aunk05 is offline   Reply With Quote
Old Today, 05:06 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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%;
}
JSWolf is offline   Reply With Quote
Old Today, 09:00 AM   #5
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
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.
aunk05 is offline   Reply With Quote
Old Today, 09:04 AM   #6
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
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.
aunk05 is offline   Reply With Quote
Old Today, 09:40 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by aunk05 View Post
Thank you so much, Kovid - that has worked perfectly, although I really still do not understand the logic behind this.
Look at the 'Box Model' description at W3C.
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 )
Attached Thumbnails
Click image for larger version

Name:	Edito Box Model.png
Views:	3
Size:	23.6 KB
ID:	222229  
theducks is offline   Reply With Quote
Reply

Tags
calibre editor, html, images, inspector, max-width


Forum Jump

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


All times are GMT -4. The time now is 12:46 PM.


MobileRead.com is a privately owned, operated and funded community.