W3C home > Mailing lists > Public > www-talk@w3.org > July to August 2003

Re: HTML Keep IMAGE Ratio

From: Reinier Post <rp@win.tue.nl>
Date: Tue, 29 Jul 2003 13:31:34 +0200
To: www-talk@w3.org
Message-ID: <20030729133134.C11315@gazelle.win.tue.nl>

On Wed, Jul 16, 2003 at 10:22:10AM -0400, John Manko wrote:
> Ok, I'm surprised that this is not taken care of with HTML.
Yes, I have also run into this problem.  But I solve it by preprocessing.

> I propose the following standard (but also looking for a
> PHP workaround if available) for the Img HTML tag:
> RATIO = Keep|Ignore, default Ignore
> &lt; img width='x' height='y' RATIO='Keep|Ignore' &gt;
> Where, RATIO=Keep will inlarge the image to a
> max WIDTH or HEIGHT (which ever comes first),
> without changing the perspective ratio.

RATIO=Ignore is equivalent to omitting it altogether.
With RATIO=Keep you suggest it should use the maximum size
that will fit.  But that will give you issues with alignment,
I think.


> consider this:
> Image1 : 100x100  (Ratio = 1:1)
> Image2 : 100x200  (Ratio = 1:2)
> Space available for display : 75x75


> Case3:
> Just specify EITHER width=75 OR heigth=75, but how
> will I know which one to specify without coding for it?
> For every image I have to check this!

True.  Often you are already doing some proprocessing anyway (e.g.
to generate smaller thumbnail images, or to compute other proportions based
on the resulting image size), so it isn't a big deal.  An alternative
is to do it with Javascript.  If neither of these apply you have a point.
But I wonder if the pain of having to support this is worth the gain
of being able to use it.

Received on Tuesday, 29 July 2003 07:31:36 UTC

This archive was generated by hypermail 2.4.0 : Monday, 20 January 2020 16:08:27 UTC