Menu

#1397 epub3/HTML5 image width percent problem

output: ePub
open
nobody
None
5
2017-04-15
2017-04-15
No

I am generating an EPUB3.

The following Docbook:

<imagedata fileref="images/mypic.jpg" width="65%"/>

is translated into:

<table style="border: 0; width: 65%; cellpadding: 0; cellspacing: 0;"><tr><td><img src="images/mypic.jpg" width="100%" alt="My picture"/></td></tr></table>

In HTML5, specifying a percentage for width is incorrect. The width and height attributes should be the actual height and width of the image so the CSS can use this information to resize if necessary.

Discussion

MongoDB Logo MongoDB