Re: [css3-images] Units for `image-resolution: from-image`

On Fri, Jul 26, 2013 at 9:55 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> Le 26/07/2013 17:39, Tab Atkins Jr. a écrit :
>> On Fri, Jul 26, 2013 at 5:41 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
>>> The 'from-image' keyword of the 'image-resolution' property is defined as
>>>
>>>      The image's intrinsic resolution is taken as that specified by the
>>> image
>>> format. If the image does not specify its own resolution, the explicitly
>>> specified resolution is used (if given), else it defaults to ‘1dppx’.
>>>
>>> The only image formats that I found that have resolution metadata are
>>> JPEG
>>> and TIFF, where it is specified in "image pixels per inches" or "per
>>> centimeter".
>>>
>>> How should this be interpreted? I think it should map to CSS in and cm
>>> (and
>>> therefore the resolution is interpreted as dpi and dpcm) rather than
>>> physical inches and centimeters, which otherwise don’t exist in CSS.
>>
>>
>> I think this is quality-of-implementation.  If you know that an image
>> format means "real inches", and you know an accurate conversion ratio
>> between real inches and CSS px on the device you're running on, then
>> you should feel free to interpret the image format's resolution as
>> accurately as possible when converting into one of the CSS units.
>>
>> If you don't have either of those pieces of information, then yes,
>> interpreting them as CSS units is perfectly appropriate.
>
>
> I disagree. "Real" physical units shouldn’t be involved, for the same reason
> we don’t have them in CSS <length>: they’re just not what you want when you
> don’t know the viewing distance, which can vary a lot between, say, a phone
> and a projector.
>
> Also, images with "image-resolution: from-image" should definitely be
> affected by both CSS transforms and user zoom, just like any other content.
> And I find "physical units when used at default zoom and unit transform"
> terrible as a concept.

While that's reasonable, still, if you know the size of a "real inch",
then you know the ratio of a real inch to a CSS in.  This can be used
to interpret the format-specified ratio in a more accurate way than
just assuming that it's referring to a CSS in.

What I'm saying is, I prefer to leave this underdefined.

~TJ

Received on Friday, 26 July 2013 17:00:09 UTC