This was working as expected in FM8 from whence my application is migrating. In FM2019 certain images are being scaled without notification.
Our XML contains img elements which have a number of attributes: srcpath, height, width, dpi, optional caption. Because of the caption, when an XML document is opened in Frame a pre-processor stylesheet wraps images in a wrapper element which is given the caption, while the other attributes remain on the img element.
Our read-write rules file contains
element "img"
{
is fm graphic element;
writer facet default specify size in pt;
attribute "src" is fm property file;
fm property import by reference or copy value is "ref";
fm property alignment value is "acenter";
fm property position value is "below";
fm property horizontal offset value is "0pt";
fm property vertical offset value is "0pt";
attribute "height" is fm property height;
attribute "width" is fm property width;
attribute "dpi" is fm property dpi;
}
and the pre-processor stylesheet includes
<xsl:template match="img">
<wrapper>
<xsl:if test="@caption">
<xsl:attribute name="caption">
<xsl:value-of select="@caption" />
</xsl:attribute>
</xsl:if>
<xsl:element name="img">
<xsl:apply-templates select="@*[local-name() != 'caption']" />
</xsl:element>
</wrapper>
</xsl:template>
The post-processor stylesheet drops the wrapper and restores any caption to the img.
If I open a document which contains two images
<img src="medium.png" height="350pt" width="245pt" dpi="72">
<img src="large.png" height="146pt" width="823pt" dpi="72">
then (without any message in the console), the medium image will be displayed at its expected size, but the large image is displayed considerably smaller.
Checking the object properties in Frame I can see medium.png is width 8.643 cm, height 12.347 cm, scaling 100%, dpi 72 dpi. But large.png is width 6.968 cm, height 1.236 cm, scaling 24%, dpi 300 dpi.
And if I save the document then the resultant XML has been changed so that the images are now
<img src="medium.png" height="350pt" width="245pt" dpi="72">
<img src="large.png" height="146pt" width="792pt" dpi="300">
It looks like any image which exceeds 792pt in width at any dpi is rescaled to 792pt wide, 300dpi, so those values appear to be significant. I haven't found a complementary rescaling because of excessive height, but perhaps none of our images are actually tall enough to trigger it.
Can anyone explain what is going on, please? And how I can stop this happening?