User:Frank Schönheit/ODF Proposals/Image Control Scale
Proposal short name
Extending the "style:repeat" attribute with a "scale" value
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
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.
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>
This proposal does not add any mandatory features or behaviors to ODF documents or applications.
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.
This feature does not require review by the Accessibility Subcommittee.