Bug 89052 - Implement css3-images image-orientation
Summary: Implement css3-images image-orientation
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/2012/CR-css3-ima...
Keywords: InRadar, WebExposed
Depends on: 89055 89624 91566 91961 93422
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 19:07 PDT by David Barr
Modified: 2018-07-18 09:53 PDT (History)
20 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Barr 2012-06-13 19:07:42 PDT
Add image-orientation support to WebKit.
http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation

The css3-images module is at candidate recommendation.

I propose to introduce the property initially behind a compile flag.
Comment 1 David Barr 2012-06-13 19:11:42 PDT
Advertised on webkit-dev:
http://thread.gmane.org/gmane.os.opendarwin.webkit.devel/21130
Comment 2 Alexey Proskuryakov 2012-06-14 09:43:28 PDT
I wonder why this property doesn't have a value to auto-rotate based on EXIF data.
Comment 3 Simon Fraser (smfr) 2012-06-14 11:50:50 PDT
This property purposefully ignores EXIF, which I think is stupid:
"Note that some devices will "tag" an image with some metadata indicating its correct orientation, so image viewing software can do the necessary transformation themselves. Due to legacy compatibility restraints, Web browsers are required to ignore this data by default. A future level of this specification is expected to have a value that applies the metadata-specified transformation automatically."

I think images with EXIF data are far more common than those encoded sideways

It's also stupid that the spec doesn't use the term "EXIF", which is what most people would search for.
Comment 4 Simon Fraser (smfr) 2012-06-14 11:51:25 PDT
David: do you have any data about how common is the issue that this property is trying to address?
Comment 5 Mike Lawther 2012-06-14 20:09:38 PDT
No hard data on this, other than searching online and finding devleopers asking on forums (eg http://stackoverflow.com/questions/1526448/rotating-an-image-using-css).

This property affects the intrinsic height/width of the image, so if eg you wanted to display a bunch of photos in a gallery and have them all portrait oriented, this would allow you to do that as well as having the layout work.
Comment 6 Simon Fraser (smfr) 2012-06-14 20:56:15 PDT
There's a thread at <http://lists.w3.org/Archives/Public/www-style/2012Feb/0311.html>
Tab says "The spec inherited this property from existing print media stuff".

I don't think this property is particularly relevant to most webkit clients. There are lots of far more pressing things to work on. If you care about image orientation, it would make far more sense to solve the EXIF problem.
Comment 7 Mike Lawther 2012-06-14 21:43:00 PDT
CSS Images Level 4 sounds like it'll add support for EXIF to image-orientation as you asked for on the thread you linked to.

Implementing the Level 3 version will lay necessary groundwork. I know of developers who would use this to eg rotate a logo to display down the side of a page (as this property affects layout). I don't see the harm in implementing this now. Would you actively object to this happening?
Comment 8 Tab Atkins Jr. 2012-06-15 08:51:57 PDT
(In reply to comment #7)
> CSS Images Level 4 sounds like it'll add support for EXIF to image-orientation as you asked for on the thread you linked to.
> 
> Implementing the Level 3 version will lay necessary groundwork. I know of developers who would use this to eg rotate a logo to display down the side of a page (as this property affects layout). I don't see the harm in implementing this now. Would you actively object to this happening?

Yup, level 4 will have a value that pays attention to EXIF, probably "from-image" or something.  Fantasai and I plan to start seriously working on Images 4 soonish.

I also agree that implementing what's currently in the draft is of some value, and would lay the groundwork for the EXIF-respecting ability later.
Comment 9 Tony Chang 2012-06-22 10:36:41 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > CSS Images Level 4 sounds like it'll add support for EXIF to image-orientation as you asked for on the thread you linked to.
> > 
> > Implementing the Level 3 version will lay necessary groundwork. I know of developers who would use this to eg rotate a logo to display down the side of a page (as this property affects layout). I don't see the harm in implementing this now. Would you actively object to this happening?
> 
> Yup, level 4 will have a value that pays attention to EXIF, probably "from-image" or something.  Fantasai and I plan to start seriously working on Images 4 soonish.

Will can one feature detect between a level 3 implementation and a level 4 implementation?  I guess you have to set image-orientation with a level 4 value and see if you can read it back out?

> I also agree that implementing what's currently in the draft is of some value, and would lay the groundwork for the EXIF-respecting ability later.

If Images 4 is starting soonish, maybe it's better to just wait until it's underway.
Comment 10 Simon Fraser (smfr) 2012-06-22 11:07:33 PDT
Bug 19688 is about respecting EXIF.
Comment 11 Tab Atkins Jr. 2012-06-25 10:53:38 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > CSS Images Level 4 sounds like it'll add support for EXIF to image-orientation as you asked for on the thread you linked to.
> > > 
> > > Implementing the Level 3 version will lay necessary groundwork. I know of developers who would use this to eg rotate a logo to display down the side of a page (as this property affects layout). I don't see the harm in implementing this now. Would you actively object to this happening?
> > 
> > Yup, level 4 will have a value that pays attention to EXIF, probably "from-image" or something.  Fantasai and I plan to start seriously working on Images 4 soonish.
> 
> Will can one feature detect between a level 3 implementation and a level 4 implementation?  I guess you have to set image-orientation with a level 4 value and see if you can read it back out?

Yup, that's the standard way to detect new values for an existing property.

(In the future, you'll be able to do this more directly.  In CSS, you'll have the @supports rule, and I imagine there will be a related CSSOM function.)

> > I also agree that implementing what's currently in the draft is of some value, and would lay the groundwork for the EXIF-respecting ability later.
> 
> If Images 4 is starting soonish, maybe it's better to just wait until it's underway.

The property isn't super important yet, but it doesn't hurt to work on it now, and it would be nice to have a passing browser implementation of the tests that I'll be writing soon.
Comment 12 Jeremy Apthorp 2012-11-03 20:00:59 PDT
David is no longer working on Chromium -- Mike, can you reassign?
Comment 13 Marc MAURICE 2015-04-03 11:44:37 PDT
Still nothing on that feature ?

It's in Firefox since ages :
http://sethfowler.org/blog/2013/09/13/new-in-firefox-26-css-image-orientation/

see also chromium issue:
https://code.google.com/p/chromium/issues/detail?id=158753

Thanks in advance !
Marc
Comment 14 Gyuyoung Kim 2015-04-03 19:40:36 PDT
(In reply to comment #13)
> Still nothing on that feature ?
> 
> It's in Firefox since ages :
> http://sethfowler.org/blog/2013/09/13/new-in-firefox-26-css-image-
> orientation/
> 
> see also chromium issue:
> https://code.google.com/p/chromium/issues/detail?id=158753
> 
> Thanks in advance !
> Marc

Hi, current EFL and GTK ports have enabled this feature.
Comment 15 yisibl 2015-07-08 20:34:56 PDT
Nobody to fix it?
Comment 16 Gyuyoung Kim 2015-08-16 19:31:35 PDT
(In reply to comment #15)
> Nobody to fix it?

What bug or feature do you want to fix ?
Comment 17 David Shepherdson 2016-08-21 04:32:11 PDT
In my view, the thing that would really help in general would be support for 'image-orientation: from-image'. That would at least provide a way to be confident images are rendered with the same orientation in iOS and desktop WebKit.
Comment 18 Simon Fraser (smfr) 2017-04-27 11:35:44 PDT
rdar://problem/31834843