OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook] DB-HTML how to scale down too wide imgages (without attr in imagedata)

On Wed, Jul 16, 2003 at 11:10:17AM +0200, Sebastian Fey wrote:
> hi,
> im just customizing the docbook-xsl style sheets for HTML output.
> i got some images that are too wide for to be displayed in the browser.
> is there a way like set a param to "800px" and each image surpassing this
> width will be scaled down?

There is no 'maximum.image.width' parameter, but it might
make a nice feature request.  8^)

> or, if not, is a template possible / existing in the sheets that returns the
> width of an image?

Yes, if you are using Saxon or Xalan, Norm has written some
XSL extension functions that attempt to extract the width
information from an image file.  In html/graphics.xsl, you will
see something like this:

<xsl:variable name="intrinsicwidth">
    <!-- This funny compound test works around a bug in XSLTC -->
      <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
          <xsl:when test="function-available('simg:getWidth')">
            <xsl:value-of select="simg:getWidth(simg:new($filename),
          <xsl:when test="function-available('ximg:getWidth')">
            <xsl:value-of select="ximg:getWidth(ximg:new($filename),
            <xsl:value-of select="$nominal.image.width"/>

The simg:getWidth is the Saxon extension, and the
ximg:getWidth is the Xalan extension.
You could use those in a customization to adjust
the width.  Unfortunately, there is no such 
extension for xsltproc yet.


Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]