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 03-30-2026, 07:09 PM   #1
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
Posts: 5
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 03-30-2026, 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,154
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 offline   Reply With Quote
Old Yesterday, 04:49 AM   #3
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
Posts: 5
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 Yesterday, 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,708
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 Yesterday, 09:00 AM   #5
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
Posts: 5
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 Yesterday, 09:04 AM   #6
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
Posts: 5
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 Yesterday, 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:	7
Size:	23.6 KB
ID:	222229  
theducks is offline   Reply With Quote
Old Yesterday, 02:28 PM   #8
aunk05
Junior Member
aunk05 began at the beginning.
 
aunk05's Avatar
 
Posts: 5
Karma: 10
Join Date: Mar 2026
Device: Kindle Paperwhite
Correction to earlier post, this time with image attached

I hope this post will have the image of the css code I used, as mentioned in an earlier post. I don't know why my image link didn't work.
Attached Thumbnails
Click image for larger version

Name:	Styles.jpg
Views:	12
Size:	58.1 KB
ID:	222233  
aunk05 is offline   Reply With Quote
Old Yesterday, 03:44 PM   #9
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,708
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I had in mind was putting that CSS code in the CSS of the eBook. That way it should also work if you are not reading with calibre's viewer.
JSWolf is offline   Reply With Quote
Old Yesterday, 06:48 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 50,963
Karma: 179232776
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by aunk05 View Post
I hope this post will have the image of the css code I used, as mentioned in an earlier post. I don't know why my image link didn't work.
Your image link did not work since to show an image on a external site, MobileRead proxies the connection. Quite a few image sites no longer allow proxied connections for third parties to view their content so that capability is becoming less than useful. Using images as attachments to the message is both more reliable and more likely to be useful in a couple of years when the image site has long since dumped your image.

The image connection for your IMG link is https://usercontent.mobileread.org/proxy/lSf9WACZpxWqm4KdlKPFC92aaQ0/aHR0cHM6Ly9pYmIuY28vVmN6MGhiNlk#https://ibb.co/Vcz0hb6Y.
DNSB 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 05:58 AM.


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