Re: KEEP IMAGE RATIO
| From: | John Manko | Date: | Wed, 16 Jul 2003 13:46:06 +0000 |
| Subject: | Re: KEEP IMAGE RATIO | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155408@lists.php.net to get a copy of this message | ||
Ok, before you go responding with percentages, I should note this.
consider this:
Image1 : 100x100 (Ratio = 1:1)
Image2 : 100x200 (Ratio = 1:2)
Space available for display : 75x75
now, i can say "width=75% height=75%", but this will
only work for Image1, since Image2 will end up
as 75x150 (which clearly does not fit the 75x75 constraints)
now, if i specify "width=75 height=75", again, this works for Image1, but
not Image2, since the new Image2 ratio will be 1:1, with Image2 losing 1/2 of it's heigth ratio.
John Manko wrote:
Ok, I'm surprised that this is not taken care of with HTML. 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. I don't want to have to use Photoshop or Gimp to ensure that the images a width=x or heigth=y will keep ratio. If anyone belongs to W3C, please consider this. Thanks