|
|
#1 |
|
Connoisseur
![]() 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? |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
|
|
|
|
|
#3 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#4 | |
|
Connoisseur
![]() Posts: 79
Karma: 10
Join Date: Nov 2025
Device: none
|
Quote:
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. |
|
|
|
|
|
|
#5 | |
|
(who/what)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 533
Karma: 5065098
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
|
Quote:
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.
|
|
|
|
|
|
|
#6 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,584
Karma: 21743811
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
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.
|
|
|
|
![]() |
|
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 |