View Single Post
Old 11-14-2010, 08:57 AM   #10
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by bfollowell View Post
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
Attached Thumbnails
Click image for larger version

Name:	testimagesizesnohisrc1.jpg
Views:	331
Size:	78.6 KB
ID:	61187   Click image for larger version

Name:	testimagesizesnohisrc2.jpg
Views:	358
Size:	109.7 KB
ID:	61188   Click image for larger version

Name:	testimagesizeswithhisrc.jpg
Views:	359
Size:	102.2 KB
ID:	61189  

Last edited by DMSmillie; 12-04-2010 at 09:01 AM. Reason: update
DMSmillie is offline   Reply With Quote