Quote:
Originally Posted by bfollowell
No, they do not. It makes no difference though. You can put whatever you want for those attributes. They're just ignored. Anything smaller than about 40% or 50% of the screen is automatically quadrupeled (doubled in height and width).
|
That's not entirely true. However your reply made me do some more testing, particularly in relation to the use of the "hisrc" attribute, and in Calibre's conversion to MOBI format.
What I've found:
1. If you don't use the "hisrc" attribute as well as the "src" attribute, you
do need to have the image height and width attributes specified, for the Kindle. If you don't, and the image fills less than 25% of the screen, it will be expanded to twice the height and width of the original. If you
do specify the image height and width, it will be displayed correctly. See attached "testimagesizesnohisrc1.jpg" and "testimagesizesnohisrc2.jpg".
2. If you
do use the "hisrc" attribute, the Kindle will use that rather than the "src" attribute, and will display that image without expanding it. See attached "testimagesizeswithhisrc.jpg".
(The MOBI files for these screen shots were created by running two almost identical HTML files through Kindlegen - the only difference between the two HTML files was that one included the "hisrc" attribute in each IMG tag, whereas the other didn't.)
3. Calibre, when converting to MOBI format, appears to be discarding the "hisrc" attribute, and also discarding the image height and width attributes. I used Calibre to create a MOBI file from an EPUB in which the HTML included "hisrc", "height" and "width" attributes, and then to convert the MOBI to OEB. When I examined the resulting HTML, all three attributes had gone.
Edited to add:
Update: As Kovid indicated, Calibre
was retaining image height and width attributes, but changing them to "em" values, rather than pixels (I discovered that the OEB output wasn't actually showing the exact HTML inside the MOBI file - now I use mobiunpack.py to see that accurately). Kindle ignores height or width values in ems inside the IMG tag. Calibre now leaves the IMG height and width attributes in their original form (height="yy" width="xx") when converting to MOBI format.
end of edit
- Donna