Re: [css3-images] 'image-resolution: from-image' based on resolution X / Y

Le 26/07/2013 19:36, Liam R E Quin a écrit :
> On Fri, 2013-07-26 at 09:52 -0700, Tab Atkins Jr. wrote:
>> On Fri, Jul 26, 2013 at 9:43 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
>>> I’m in favor of allowing two values (including specifying two in CSS.) If
>>> the WG rejects that, use the horizontal one.
>
> If you use the horizontal one and ignore the vertical you'll get an
> image that appears "stretched" and pixelated vertically.
>
> Correct would be to scale (resample) the image.
>
> E.g. if you have an image that's 300dpi horizontally and 200 dpi
> vertically, e.g from a fax machine, and it's 600 x 400 pixels, it should
> be displayed as a 2inch square. An implementation could do this by
> scaling it down to 400x400 pixels and then using 400dpi as the
> resolution, or by scaling it up to 600x600 pixels and using 300dpi.
>
> A print implementation can just pass on the differing values to the
> renderer, which can quite likely handle this case as input to the
> screening algorithm, or can use a transform without resampling.

This seems like a convoluted way of saying than we should support two 
different X / Y values, which I agree is the right thing to do. (Whether 
there is one or more intermediate re-sampling is an implementation details.)

But given that the less-complex version of this property is already 
at-risk, I was also suggesting a fallback plan in case some implementers 
reject the additional complexity.


> Of course if no-one actually has any of these hypothetical images it
> doesn't really matter. I've seen them from time to time - I suspect
> they're not used on the Web much because browsers don't handle them.
>
> PNG can also have differing X and Y resolutions, by the way, which I've
> only really encountered after making a mistake with a scanner.

Earlier I missed that PNG supports resolution metadata at all because it 
doesn’t use that name, but yes, that should be supported as well.


-- 
Simon Sapin

Received on Saturday, 27 July 2013 00:07:48 UTC