Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 10:16 AM   #1
icearch
Connoisseur
icearch began at the beginning.
 
Posts: 79
Karma: 10
Join Date: Nov 2025
Device: none
Using absolute units in img width tends to fail

Using absolute units in img width tends to fail in a lot of reader apps. They simply ignore that and stretch the img to 100% or original size.

Resizing img in advance kinna hurts it's quality, and pretty annoying. Any good way to fix this?
icearch is offline   Reply With Quote
Old Today, 10:31 AM   #2
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,938
Karma: 106187745
Join Date: Apr 2011
Device: pb360
Why not use %, especially since you don't know the PPI of the display?
j.p.s is offline   Reply With Quote
Old Today, 10:53 AM   #3
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,054
Karma: 150831497
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
One other option is if the absolute units make the image smaller then it is, resize the image to that size. Then you don't have to use absolute units.
JSWolf is online now   Reply With Quote
Old Today, 11:36 AM   #4
icearch
Connoisseur
icearch began at the beginning.
 
Posts: 79
Karma: 10
Join Date: Nov 2025
Device: none
Quote:
Originally Posted by j.p.s View Post
Why not use %, especially since you don't know the PPI of the display?
Using % can have some other problems in certain reader app, but a lot more acceptable. But I prefer learning more things so I'm asking anyway.

As to ppi, I don't think that's how it's working? px is 1/96 in, have nothing to do with pixel so nothing to do with ppi.
icearch is offline   Reply With Quote
Old Today, 11:49 AM   #5
slm
(who/what)
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 533
Karma: 5065098
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
Quote:
Originally Posted by icearch View Post
px is 1/96 in, have nothing to do with pixel so nothing to do with ppi.
Not quite: from https://www.w3schools.com/cssref/css_units.php:
Pixels (px) are relative to the viewing device. For low-dpi devices, 1px is one device pixel (dot) of the display. For printers and high resolution screens 1px implies multiple device pixels
I don't know that many modern readers or screens have less than 96ppi, so in practice, I guess, 1/96 in is likely to be accurate.
slm is offline   Reply With Quote
Old Today, 01:39 PM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,584
Karma: 21743811
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by j.p.s View Post
Why not use %, especially since you don't know the PPI of the display?
Because if you want 3cm, % doesn't help. You don't know the ppi, and you don't know the screen size. But if you do know you want 3cm, you should be able to say 3cm, and the device should know what to do with it.
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
css if img aspect-ratio >1/1 width:100%, otherwise width:50% rjwse@aol.com Editor 0 03-19-2021 08:41 AM
4.11.1 right click img in editor to edit img rjwse@aol.com Calibre 1 02-21-2020 10:29 PM
change img or box width for multi-column in calibre viewer rjwse@aol.com Calibre 2 12-02-2019 11:48 AM
Zero-width non joiner vs. zero width space? Phssthpok Editor 3 09-06-2015 04:45 AM
WIDTH and HEIGHT in <img> tags Pablo Sigil 3 06-10-2010 06:37 PM


All times are GMT -4. The time now is 04:19 PM.


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