Difference between revisions of "User:Frank Schönheit/ODF Proposals/Image Control Scale"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Text changes/additions)
(Schema changes/additions)
 
Line 61: Line 61:
 
style-graphic-fill-properties-attlist definition needs to be changed as follows:
 
style-graphic-fill-properties-attlist definition needs to be changed as follows:
  
,-----------------------------------------------------------------------------------------
+
<code>
|
+
<define name="style-graphic-fill-properties-attlist" combine="interleave">
| <define name="style-graphic-fill-properties-attlist" combine="interleave">
+
    <optional>
|    <optional>
+
        <attribute name="style:repeat">
|        <attribute name="style:repeat">
+
            <choice>
|            <choice>
+
                <value>no-repeat</value>
|                <value>no-repeat</value>
+
                <value>repeat</value>
|                <value>repeat</value>
+
                <value>stretch</value>
|                <value>stretch</value>
+
                <value>scale</value>
|                <value>scale</value>
+
            </choice>
|            </choice>
+
        </attribute>
|        </attribute>
+
    </optional>
|    </optional>
+
</define>
| </define>
+
</code>
|
+
`-----------------------------------------------------------------------------------------
+
  
 
For consistency, also the definition of style:repeat as part of the
 
For consistency, also the definition of style:repeat as part of the
 
style-background-image-attlist definition needs to be changed, as follows:
 
style-background-image-attlist definition needs to be changed, as follows:
  
,-----------------------------------------------------------------------------------------
+
<code>
|
+
<define name="style-background-image-attlist" combine="interleave">
| <define name="style-background-image-attlist" combine="interleave">
+
    <optional>
|    <optional>
+
        <attribute name="style:repeat" a:defaultValue="repeat">
|        <attribute name="style:repeat" a:defaultValue="repeat">
+
            <choice>
|            <choice>
+
                <value>no-repeat</value>
|                <value>no-repeat</value>
+
                <value>repeat</value>
|                <value>repeat</value>
+
                <value>stretch</value>
|                <value>stretch</value>
+
                <value>scale</value>
|                <value>scale</value>
+
            </choice>
|            </choice>
+
        </attribute>
|        </attribute>
+
    </optional>
|    </optional>
+
</define>
| </define>
+
</code>
|
+
`-----------------------------------------------------------------------------------------
+
  
 
= Impacts =
 
= Impacts =

Latest revision as of 20:13, 1 July 2009

Summary

Proposal owner

...

Proposal short name

Extending the "style:repeat" attribute with a "scale" value

Rationale

Use cases:

In ODF documents, one means to display images is by using form controls, namely the components described by a form:image resp. form:image-frame element, whose sole purpose is exactly this: display an image to the user. Now if the source of the image is not known at design time of the document (for instance, if the image is taken from a database at runtime), then it's up to impossible for the designer of the document to specify the correct dimensions for the form control, since she does not know the later image's dimensions.

Thus, it might be desirable to the creator of such a document to specify that the image, which is to be displayed in the control, should be stretched or scaled, to fit the control dimensions.

Looking at existing ODF definitions, "style:repeat" seems to be the natural choice for storing this information: It already allows for a value "stretch", which requires aninsotropic stretching of the image over the affected area, so adding an additional value for isotropic scaling would make sense.

Requested changes to the ODF Standard

Text changes/additions

change section "18.811 style:repeat" to:

 18.811. style:repeat

  The style:repeat attribute specifies if an image can be repeated or stretched over a
  particular area. The value of the attribute can be no-repeat, repeat, stretch, or scale.

  The value stretch means that the image is stretched to completely cover the particular
  area, by possibily distorting the images aspect ratio.

  The value scale means that the image is scaled to cover as much of the particular
  area as possible, by preserving its aspect ratio.

  attribute-style:repeat

Note: section numbers and texts are taken from OpenDocument-v1.2-draft7-5.odt

Note: The value "scale" was chosen for consistency with "style:rel-height" and "style:rel-width" attributes, which also allow for a special value "scale", denoting isotropic scaling there.

Schema changes/additions

The definition of the style:repeat attribute as part of the style-graphic-fill-properties-attlist definition needs to be changed as follows:

<define name="style-graphic-fill-properties-attlist" combine="interleave">
    <optional>
        <attribute name="style:repeat">
            <choice>
                <value>no-repeat</value>
                <value>repeat</value>
                <value>stretch</value>
                <value>scale</value>
            </choice>
        </attribute>
    </optional>
</define>

For consistency, also the definition of style:repeat as part of the style-background-image-attlist definition needs to be changed, as follows:

<define name="style-background-image-attlist" combine="interleave">
    <optional>
        <attribute name="style:repeat" a:defaultValue="repeat">
            <choice>
                <value>no-repeat</value>
                <value>repeat</value>
                <value>stretch</value>
                <value>scale</value>
            </choice>
        </attribute>
    </optional>
</define>

Impacts

Conformance

This proposal does not add any mandatory features or behaviors to ODF documents or applications.

Backwards compatibility

Existing ODF processors will ignore the newly defined value for the style:repeat attribute, and default to a value as if this attribute would not be present.

Accessibility impact

This feature does not require review by the Accessibility Subcommittee.

Personal tools