W3C home > Mailing lists > Public > public-respimg@w3.org > November 2014

Re: Informing the browser of the expected size of the image

From: Simon Pieters <simonp@opera.com>
Date: Mon, 10 Nov 2014 11:14:42 +0100
To: Attiks <attiks@gmail.com>, steve@steveclaflin.com
Cc: "Nelson Menezes" <nelson@fittopage.org>, "Greg Whitworth" <gwhit@microsoft.com>, "Yoav Weiss" <yoav@yoav.ws>, Fréd\"éric Kayser\" <f.kayser@free.fr>, public-respimg@w3.org, "Simon Miles-Taylor" <smilestaylor@gmail.com>, "Ilya Grigorik" <igrigorik@google.com>
Message-ID: <op.xo3teshjidj3kv@simons-mbp>
On Fri, 07 Nov 2014 18:39:29 +0100, <steve@steveclaflin.com> wrote:

> I agree in terms of best practices, but I don't think the spec for img  
> disallows the use of urls with different aspect ratios in srcset.  So  
> then a question arises as to whether the syntax should support legal but  
> bad practices.

We don't need to support bad practices. We should generally make it hard  
to use a feature incorrectly. That suggests it shouldn't be possible to  
specify different aspect ratios for different URLs in srcset, since they  
should all be the same.

However, it's possible that rounding errors causes the aspect ratios in  
srcset to be slightly different. For instance, say you have an image that  
is 1000x200. A scaled down version could be 333x67, which is perfectly  
fine but is different aspect ratio. If we want the placeholder box to have  
exactly the right size, this suggests we should allow (but not necessarily  
require) specifying width/height or aspect ratio for each URL.

Also see https://github.com/ResponsiveImagesCG/picture-element/issues/85  
for more discussion.

Simon Pieters
Opera Software
Received on Monday, 10 November 2014 10:15:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:06:15 UTC