This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: [docbook] DB-HTML how to scale down too wide imgages (without attr in imagedata)
- From: Bob Stayton <bobs at sco dot com>
- To: Sebastian Fey <fey at parsytec dot de>
- Cc: docbook at lists dot oasis-open dot org
- Date: Wed, 16 Jul 2003 08:31:54 -0700
- Subject: Re: [docbook] DB-HTML how to scale down too wide imgages (without attr in imagedata)
- References: <KLELIOFMGDKLJFHJHGFPAEGKCAAA.fey@parsytec.de>
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:choose>
<xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
<xsl:choose>
<xsl:when test="function-available('simg:getWidth')">
<xsl:value-of select="simg:getWidth(simg:new($filename),
$nominal.image.width)"/>
</xsl:when>
<xsl:when test="function-available('ximg:getWidth')">
<xsl:value-of select="ximg:getWidth(ximg:new($filename),
$nominal.image.width)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nominal.image.width"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
...
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
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org