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

For <video> the rotation is applied to videoWidth and videoHeight, at least
in Chromium/Blink. A video with rotation metadata is thus indistinguishable
from one where the frame themselves are rotated.

If there's any hope that doing the same for <img> could be Web compatible,
and Safari's behavior makes that seem likely, that seems like a pretty good
outcome.

Philip

On Fri, Mar 13, 2015 at 6:14 AM, Seth Fowler <seth@mozilla.com> wrote:

> The more I think about this, the more I agree with David. It really does
> make more sense to act like the rotation is part of the image format,
> because after all it *is*, at least when from-image is used.
>
> This approach also gives us a smoother path to eventually respecting EXIF
> orientation by default. If we did that, we’d want naturalWidth and
> naturalHeight to take EXIF orientation into account, so planning for that
> with the behavior of image-orientation makes sense.
>
> And FWIW, Safari (which respects EXIF orientation in image documents and
> by default on mobile) does appear to take EXIF orientation into account for
> naturalWidth and naturalHeight, so this approach is web compatible.
>
> Consider this a second vote for “naturalWidth and naturalHeight should
> respect image-orientation”.
>
> - Seth
>
> > On Mar 10, 2015, at 10:09 AM, L. David Baron <dbaron@dbaron.org> wrote:
> >
> > On Monday 2015-03-09 16:52 -0700, Tab Atkins Jr. wrote:
> >> That's a good question.  I suspect that .naturalWidth/Height should
> >> return the image's dimensions before applying CSS rotations.  This is
> >> likely to be surprising, but also probably the correct answer for
> >> separation-of-concerns reasons.
> >>
> >> I wonder whether I need to tweak Images, or Hixie needs tweak <img>.
> Hmm.
> >
> > I really think that the mechanism for opting in to honoring EXIF
> > should make the browser act as though the rotation were in the image
> > format.
> >
> > It's a compatibility hack (because implementations were initially
> > shipping without EXIF support, and there may be a dependency on
> > that), but once the developer has opted in, everything should really
> > act like the rotation is part of the image format.
> >
> > -David
> >
> > --
> > 𝄞   L. David Baron                         http://dbaron.org/   𝄂
> > 𝄢   Mozilla                          https://www.mozilla.org/   𝄂
> >             Before I built a wall I'd ask to know
> >             What I was walling in or walling out,
> >             And to whom I was like to give offense.
> >               - Robert Frost, Mending Wall (1914)
>
>

Received on Friday, 13 March 2015 06:39:32 UTC