This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: image sizes
- From: Doug du Boulay <ddb at R3401 dot msl dot titech dot ac dot jp>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Thu, 20 Feb 2003 10:58:10 +0900
- Subject: Re: DOCBOOK-APPS: image sizes
- References: <200302191033.AA2877882652@hams-hsc.hsc.edu>
- Reply-to: ddb at R3401 dot msl dot titech dot ac dot jp
> >Doug du Boulay <ddb at R3401 dot msl dot titech dot ac dot jp> writes:
> >> I am using dsssl with openjade and the docbook stylesheets to render
> >> html and with pdfjadetex to render pdf format.
> >>
> >> I would like to know what is the best way to control image sizes in both
> >> output formats from the docbook markup.
> >> These dont seem to be honoured by the tex output.
> >> and specifying units of "Ncm" trashes the html output.
On Wednesday 19 February 2003 23:21, Adam DiCarlo wrote:
> I can't really answer that, and it probalby depends on whether your
> source image is resolution independent or not. But if you send me
> some test XML files with examples of this I'm happy to try to fix the
> DSSSL bugs.
Sorry. Sloppy usage of the word "trash" on my part. What I should of said
was that using "Ncm" shrunk the html images smaller than a gnats ring.
I am certain the HTML was still well formed.
Maybe cm units were replaced by pixels...?
> >>
> >> what is the best strategy?
On Thursday 20 February 2003 00:33, Kevin Dunn wrote:
> I store my original images as *.tiff files and then use ImageMagick to
> convert to (possibly lower resolution) png and jpg files for use in html
> and pdf outputs. For example:
>
> High resolution file:
> convert -quality 75 -density 300 srcimg/image.tif hrimg/image.jpg
>
> Lower resolution file:
> convert -geometry 48% -quality 50 -density 144 srcimg/image.tif
> lrimg/image.jpg
>
> Since 144/.48 = 300, the image sizes are the same. Since the dimensions in
> pixels may differ from html to pdf, I leave the WIDTH and DEPTH attributes
> blank. You can choose any combination of density and geometry to get your
> files to be the proper size for html. I keep separate "versions" (lrimg,
> hrimg) of the graphics in separate directories and then just cp -R the
> appropriate directory to "images" before running openjade. My imagedata
> tags refer to all files as, for example:
>
> <imagedata fileref="images/image.jpg" format="JPG"/>
>
Thanks Adam, thanks Kevin.
Actually I discovered that the stock dsssl1.77 stylesheets respond perfectly
well to:
<imagedata fileref="images/image.jpg" format="JPG" width="80%" scale="80">
The width attribute is only used by HTML and the scale attribute
(which is a percent without the % sign) is only used in the tex output.
All other image scaling attribute controls permitted by the DTD seem to be
ignored by the dsssl stylesheets (obvious really, !).
What I dont know is what the widths and scales are percentages of. The
original figures widths? the page width? the text-column width?
I have no idea what magic goes on within web-browsers or tex to impose this
spec.
For my current needs, image quality is not such a pressing issue. But I will
certainly keep the convert/resolution file replacement tricks in mind for
future! Thanks again for your inputs.
Doug