W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2015

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

From: Seth Fowler <seth@mozilla.com>
Date: Mon, 9 Mar 2015 16:01:51 -0700
Message-Id: <0DAC2FCB-58E6-46D5-B9E5-350DBE4C2C3B@mozilla.com>
To: whatwg@whatwg.org
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:

"The intrinsic height and width are derived from the rotated rather than the original image dimensions.”

The HTML spec says:

"The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and height of the image, in CSS pixels, if the image is available, or else 0.”

On the surface, it seems clear that image-orientation must affect naturalWidth/Height. However, I’m not sure whether this was intended, and I don’t have a strong intuition for whether this is more or less surprising to content authors than having these two features be totally independent.

There is certainly a potential performance cost if the two features do interact, since that means that naturalWidth/Height will depend on style information. On the other hand, naturalWidth and naturalHeight would definitely take EXIF orientation into account if we respected it by default, so perhaps they also should when content authors opt in to EXIF orientation support using image-orientation.

Let me know what you think.

- Seth
Received on Monday, 9 March 2015 23:02:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:29 UTC