In earlier versions of the DITA OT (e.g., 1.8.2), when <image> was preprocessed, the dita-ot:image-width="" and dita-ot:image-height="" attributes were added to the <image> element. This enabled the image/@scale template to work by using the scale attribute as a multiplying factor against the pixel count in these two attributes, so the output <img> tag would get new width and height attribute values in terms of pixel count. However, in DITA OT 2.2.2, unless I'm doing something wrong, the dita-ot:image-width="" and dita-ot:image-height="" attributes are not inserted during preprocessing. The image/@scale template for XHTML appears not to be updated to handle this situation, so the output width and height attributes receive "NaN" values, and the image is not scaled.
The specific template is in dita-ot-2.2.2/plugins/org.dita.xhtml/xsl/xslhtml/dita2htmlImpl.xsl:
<!-- AM: handling for scale attribute -->
<xsl:template match="*[contains(@class, ' topic/image ')]/@scale">
<xsl:variable name="width" select="../@dita-ot:image-width"/>
<xsl:variable name="height" select="../@dita-ot:image-height"/>
<xsl:if test="not(../@width) and not(../@height)">
<xsl:attribute name="height" select="floor(number($height) * number(.) div 100)"/>
<xsl:attribute name="width" select="floor(number($width) * number(.) div 100)"/>
</xsl:if>
</xsl:template>
Is there a means to get the dita-ot:image-width="" and dita-ot:image-height="" attributes back, or have they been deprecated? If deprecated, is there an alternative means to get the absolute size of the original image file to be able to apply the scaling factor to derive absolute measurements? For HTML5, the height and width attributes no longer take percentages, so specific measurements must be supplied.