Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2535

Scaling an image' height relatively to its parent-block' height

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5
    • None
    • fo/block
    • None

    Description

      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".

      <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>
      

      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

      Attachments

        1. external_graphic_height_percentage.fo
          0.6 kB
          Seifeddine Dridi

        Activity

          People

            Unassigned Unassigned
            sdridi Seifeddine Dridi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: