Re: [whatwg] Effect of image-orientation on naturalWidth/Height

On 3/9/15, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Mon, Mar 9, 2015 at 4:01 PM, Seth Fowler <seth@mozilla.com> wrote:



On 3/9/15, Seth Fowler <seth@mozilla.com> wrote:
> Hi all!
>
> I wanted to get the opinion of this list on how image-orientation and the
> <img> element's naturalWidth and naturalHeight properties should interact.
> The css-images level 3 spec says:
>

So there is now a property called naturalWidth and that is the
intrinsic width. And you want to know about the rotation and how that
affects it. Great question. ... but I have a different question:-

 Why not call it what it is?

More names for the same thing adds more confusion.  There is already
enough complexity with intrinsic width, the width property,
computedStyle's width, and clientWidth.

Calling intrinsic width, a term that has existed for years,
naturalWidth - adds complexity.

APIs that use ubiquitous language are generally less confusing than
those that do otherwise. Or maybe I've misunderstood Evans' DDD.

> That's a good question.  I suspect that .naturalWidth/Height should
> return the image's dimensions before applying CSS rotations.

I think that that is not what Seth was asking about. IIUC, he asked
about EXIF rotation info. When you take a pic in your iPhone, if there
is rotation data on it, and if that data is not removed, the image
will look rotated in browsers that recognize this header, like Safari.
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io
personx.tumblr.com

Received on Tuesday, 10 March 2015 00:06:37 UTC