You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Seifeddine Dridi (JIRA)" <ji...@apache.org> on 2015/10/19 16:35:05 UTC

[jira] [Created] (FOP-2535) Scaling an image' height relatively to its parent-block' height

Seifeddine Dridi created FOP-2535:
-------------------------------------

             Summary: Scaling an image' height relatively to its parent-block' height
                 Key: FOP-2535
                 URL: https://issues.apache.org/jira/browse/FOP-2535
             Project: FOP
          Issue Type: Bug
          Components: fo/block
    Affects Versions: trunk
            Reporter: Seifeddine Dridi


I noticed that FOP does not support scaling an image' height using percentage.

In the example below, we set the image' height to be 50% of its parent block (the expected height should be 2.5 cm; 5 cm * 0.5 = 2.5 cm). However, FOP sets the image' height exactly like its ancestor block (if we ignore alignment offset). As a matter of fact, the image' height is always resolved the same regardless of the value of attribute "height".

{code}
<fo:block-container position="absolute" height="5cm">
<fo:block>
<fo:external-graphic src="image.jpg" height="50%" content-height="scale-to-fit"/>
</fo:block>
</fo:block-container>
{code}

Judging from the latest revision of the source code, it seems that FOP resolves the image' height using the parent containing-block-area rather than the containing-reference-area. This subtle difference makes it impossible to scale an image relatively to its parent block-container.

Any thoughts?

Thanks




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)