Highlighted

Framemaker 2019 messing up image properties, why?

Explorer ,
Dec 04, 2018

Copy link to clipboard

Copied

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?

TOPICS
Structured

Views

480

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Framemaker 2019 messing up image properties, why?

Explorer ,
Dec 04, 2018

Copy link to clipboard

Copied

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?

TOPICS
Structured

Views

481

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 04, 2018 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

Hi Trevor, did you find a solution? We encounter a similar problem with rescaling graphics which was not present in FM 2015.

Although we work with sgml files. In FM2017 and FM2019, if we open one of the sgml files in FrameMaker some of our graphics get scaled down. We found out that if we skip the dpi attribute and use

"writer anchored frame specify size in cm;" in our read write rules when we create the sgml file that then the figures are not rescaled anymore.

The sgml file has then the impsize attribute set for the figure element containing the correct size of the figure.

The Adobe Manual "Developing Structured Applications with Adobe FrameMaker 2019", chapter "Changing how FrameMaker writes out the size of a graphic" says, when there is no specify size rule set, FramMaker will use the "dpi" attribute.

It seems that the "dpi" calculation in FrameMaker 2017 has changed.

Best Regards

Thomas

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 16, 2019 0
Explorer ,
Jan 17, 2019

Copy link to clipboard

Copied

Hi Thomas

I haven't got a solution yet, the problem is with Adobe support who seem to have accepted it is a bug.

It seems to me that there are two separate problems here: (1) the image scaling is triggered unnecessarily, and (2) when the image is scaled the width is changed but the height is not. I think your suggested rule change may address the first of these.

cheers

T

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 17, 2019 0