Search the web
Sign In
New User? Sign Up
dita-users · DITA users group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Image scale attribute - correct treatment in html outputs   Message List  
Reply | Forward Message #11697 of 16196 |
Re: Image scale attribute - correct treatment in html outputs

So is it true then that Open Toolkit 1.4 does not support the image
scale attribute? I haven't been able to find this stated clearly
anywhere.

Is there any way to get the scale attribute to work?

-Roger Hadley



I haven't been able to find
--- In dita-users@yahoogroups.com, "Edgar D' Souza"
<edgar.b.dsouza@...> wrote:
>
> Hi, Richard,
>
> On Tue, Sep 9, 2008 at 9:34 PM, Richard Simms <richard.simms@...>
wrote:
> > I'm just wondering if anyone has any insight into the correct use
of
> > the scale attribute for images? We are generating html output and
have
> > run into an issue where scaling is not working as we expected.
> >
> > The DITA 1.1 spec says this about the scale attribute:
> > "Specifies a percentage by which to scale the image in the
absence of
> > any specified image height or width; a value of 100 implies that
the
> > image should be presented at its intrinsic size. If a value has
been
> > specified for this image's height or width attribute (or both),
the
> > scale attribute is ignored."
> >
> > In an html file, I would have assumed that to scale the image I
would
> > need both the scale attribute and width and/or height so that I
could
> > adjust the width/height by the specified scaling percentage. For
> > example, if I have an image with width="66" and scale="50" then
the
> > resulting html would have width="33"
>
> Your quote from the spec says that the scale attribute is *ignored*
if
> height and/or width have values - so I don't really see how you've
> arrived at this combinatorial theory :-) It seems likelier that your
> image will be squeezed down to a width of 66 units (pixels?) and the
> scale attribute's value will be entirely ignored.
>
> > Or, is the scaling mean't to be interpreted as applying a
percentage
> > value directly to the width and height attributes. In other words,
> > scaling the image to a % of the containing block? For example, if
I
> > have an image with scale="50" then the resulting html would have
> > width="50%" and height="50%"
> >
> > Or, do I need to determine the intrinsic width and height of an
image
> > in the absence of explicit values for width and height and then
apply
> > the scaling factor to those values?
>
> As far as I understand it, and have attempted to work with these
> attributes (in PDF output, so YMMV):
> - the scale attribute scales down the image's representation in the
> XMetal editor, as a percentage of the image's actual (intrinsic, you
> call it?) width and height. This seems to follow the DITA spec.
> However, the image in the PDF output seems to totally ignore the
scale
> attribute - it seems to wind up lost somewhere down the processing
> chain.
> - the height and width attributes do work in the output PDF - they
> impose a more reasonable size on the image. I imagine it should work
> similarly in HTML output, since it is possible to specify those same
> attributes in an img element, to set the displayed size.
>
> There are two possible approaches to scaling your images:
> Someone else had posted, in another thread, about a solution that
they
> used: paste each new image into a transparent "canvas" image whose
> height and width were the maximum possible to display within the
> margins in the PDF. The pasted image was resized to fit within the
> 'canvas', then saved it as a new image which was used in the image
> element in the DITA topic. This made sure the image (screenshot or
> whatever) was already scaled down to a reasonable size *before* it
was
> processed by the DITA OT.
>
> We tried that out, and found it was a bit of extra work that had to
be
> repeated for every screenshot, and every time the screenshot was
> re-taken... which, when working with software that is undergoing
> development, happens often :-( So I wound up writing a Python script
> to slog through multiple subfolders of DITA topics, opening the
images
> referred to in each image element, retrieving their intrinsic
> height/width numbers, applying a scaling factor, and writing height
> and width attribute values to the image element in the DITA topic
> file. This has given us (thus far) acceptable output, and frees us
> from spending much time with Photoshop or equivalent image editors.
> Our current subset of three dozen or so DITA files is processed in
> under a second with this script, so we do save a bit of time as
> compared to resizing in Photoshop or GIMP/GIMPShop.
>
> HTH
> Ed.
>





Wed Sep 17, 2008 6:32 pm

rogerhadley
Offline Offline
Send Email Send Email

Forward
Message #11697 of 16196 |
Expand Messages Author Sort by Date

I'm just wondering if anyone has any insight into the correct use of the scale attribute for images? We are generating html output and have run into an issue...
Richard Simms
richard_simms
Offline Send Email
Sep 9, 2008
4:05 pm

Hi, Richard, ... Your quote from the spec says that the scale attribute is *ignored* if height and/or width have values - so I don't really see how you've ...
Edgar D' Souza
ed_dsouza_yc
Offline Send Email
Sep 10, 2008
6:15 am

So is it true then that Open Toolkit 1.4 does not support the image scale attribute? I haven't been able to find this stated clearly anywhere. Is there any way...
rogerhadley
Offline Send Email
Sep 17, 2008
6:33 pm

... Frankly, I haven't investigated XHTML output; our primary concern is getting PDF output to the level at which we get it from most other tools. As far as...
Edgar D' Souza
ed_dsouza_yc
Offline Send Email
Sep 18, 2008
4:31 am

... I'm certain that for XHTML, DITA-OT thinks it supports @scale. There are lots of references to it in the XSLT. But I have a suspicion that the...
Deborah Pickett
deborah_arie...
Offline Send Email
Sep 18, 2008
5:30 am

... Having run into the same problem, I am reopening this discussion... After a simple test I came to the conclusion that it is sufficient to set either width...
Giancarlo Luxardo
gluxardo
Offline Send Email
Dec 6, 2008
10:03 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help