Re: HTML Keep IMAGE Ratio

On Wed, Jul 16, 2003 at 10:22:10AM -0400, John Manko wrote:
> 
> KEEP IMAGE RATIO
> 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
> 
> < img width='x' height='y' RATIO='Keep|Ignore' >
> 
> 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.

-- 
Reinier

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