Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[css-images] Should the values of image-orientation include the <angle> variants? #4164
In https://drafts.csswg.org/css-images/#the-image-orientation there's a Note that says that
Is that still true? Issue #3799 talks about the default value, but not what other values are available.
What are the use cases for with optional flip?
Also, why is 'image-orientation' missing from css-images-4?
Dunno! Need to investigate.
It allows for the other 4 EXIF orientations.
Images 4 is mostly a delta spec. It's kinda mixed up and messy right now, tho, so the confusion is understandable.
Mozilla shipped then unshipped: https://groups.google.com/forum/#!msg/mozilla.dev.platform/A1aaENcsR6k/fPB1AvyaCAAJ
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Should the values of image-orientation include the <angle> variants?
<dael> github: https://github.com//issues/4164
<dael> smfr: WK is orkging on image-orientation. there's one with angles and one without. ANy other browsers interested in angle variants?
<dael> fantasai: B/c we made from-image default orientation I don't think strong use case for none. If not having web compat problems is this a necessary property? Still need definition b/c css print profile. If defaulting to exif do we nee dproperty at all?
<dbaron> I didn't think the <angle> values were useful...
<dael> TabAtkins: I don't recall affermative use cases for none
<dael> myles: easier to add css to fix a busted image then to rotate
<dael> fantasai: True. Ideally information should be in image or html. If photo is sideways it's data is wrong
<dael> [everyone tlaks]
<dael> fantasai: If you turn off css or in reader mode you want it to be upright. If image is wrong you should fundamentally fix and not patch with css
<dael> emilio: Gecko impl the angle values and unshipped when spec deprecated it. I don't think it's a lot of work to re-implement them
<dael> dbaron: I also don't think that useful and a weird use of angles
<dael> myles: Under spec b/c don't say which orientation rotated from
<fantasai> rotated from the orientation before applying EXIF
<dael> TabAtkins: q on myles comment. Use case was something where image pixel are correct and exif is busted? Or more broad?
<svoisen> jensimmons: It's Charlie's last week so, while it would be nice to have additional language for clarity on rendering of wavy lines, it's not something we will get to in the very near term.
<dael> myles: Yes. Comment not about nalge value, but presence of property
<fantasai> svoisen, tell Charlie to make it look good :)
<fantasai> svoisen, since that's basically what the spec is going to try to say ;)
<jensimmons> fantasai: that’s what I said…. just make it purtier
<dael> TabAtkins: With regards to angles unspec implication was rotation from none...says 0deg corrisponds to none. Implies you rotate from that. I don't think underspec, but can be tweaked. Hopefully don't need to be impl. They're there b/c print renderers have them.
<myles> TabAtkins: where does it say that 0 means none?
<myles> i don't see it
<svoisen> fantasai: Ha, fair enough :) We will have to save that as a task for someone else.
<dael> smfr: fantasai suggested removing prop. But if Moz has been shipping with from-image removing is tricky. emilio do you have info on how long shipped?
<Rossen_> ack emilio
<dael> emilio: I don't think we have use counters. Could add. Been shipping for a long time if I recall. I'll find a link
<dael> dbaron: If we're going to try and change default I would suspect that any of the things using it are doing so to set from-image not none
<dael> fantasai: +1
<dael> fantasai: Unless using it to set a value other than from-image there's not a change if we remove property. Already resolved to change initial to from-image so might not need property
<dael> smfr: Possible to get photos with bad exif information. If you pic straight down you get an angle. I can imagine trying to fix that. It does fail with things that strip css
<dael> fantasai: My inclination is impl that support this try and switch to from-image as default. Impl that don't change to from or exif. If that works we try and remove property. If it doesn't we keep
<dbaron> What fantasai just said sounds like a good plan to me.
<dael> plinss: If building photo editing software might want to show image naturally as it is and then manually rotate
<dael> TabAtkins: Editing you're parsing photo into a canvas?
<dael> plinss: Maybe. Could parse exif data yourself, but there is utility to keeping. Agree from-image and none ar only prop with from-image as default
<dael> Rossen_: unshipping of moz behavior and resolve on that behavior
<dael> Rossen_: Which way are we leaning?
<dael> TabAtkins: Fine with dropping if impl are okay on supposition we can make switch to from-image
<dael> plinss: Compat risk when I was writing code for this you don't know if browser will rotate and can't tell. Anyone with code that cares about this is already screwed so wouldn't worry about compat.
<dael> plinss: WOuld be nice if you can tell browser rotated but don't know how to tell in css
<dael> fantasai: Query size of box if it's not square and get aspect ratio. Can tell you a bit
<dael> plinss: But then have to parse image and then you might as well parse exif data
<dael> Rossen_: Leaning toward dropping image-orientation
<dael> fantasai: Prop: update note in draft to indicate we might drop the entire property for browsers and keep a definition with the <angle> values for historical reasons and say it's optional. Then remove. Or information this is in css print by not rec for impl
<dael> Rossen_: Prop: Update note saying this is not for implementation and will be dropped
<dael> Rossen_: Objections?
<dael> RESOLVED: Update note saying this is not for implementation and will be dropped
…ttps://lists.w3.org/Archives/Public/www-style/2019Aug/0005.html>. Related to discussion in #4164
Alright, I have
If we end up removing the property, probably what we should do is to revert it to the form referenced from the CSS Print Profile https://www.w3.org/TR/css-print/ and put it in an informative appendix, and very clearly mark it obsolete.
For security reasons <https://en.wikipedia.org/wiki/Exif#Privacy_and_security> many imagehosts routinely strip Exif from uploads and don't necessarily rotate the image in the process. Imgur is a popular example. If I've misunderstood the issue please accept my apologies in advance.
Current browser behavior (except for iOS Safari) is to ignore EXIF orientation (in most cases). The change to the default behavior to respect the EXIF orientation could break web content that is currently working (except maybe in iOS Safari). The
So if we're removing the property, we should have something else to recommend instead. What is it?
I can think of:
Am I missing some other option? If (1) and (2) are non-options for some people, I wouldn't want to recommend (3). It seems worse than
One case I can submit is the following:
I have a few concerns:
Re (4): I think the "moved to HTML" was the idea to introduce an attribute to
Assuming honoring EXIF by default is Web-compatible, it is the right way to go. At that point
@noell It was specced for printers originally, I think. https://www.w3.org/TR/2006/WD-css3-page-20061010/#orienting One of the use cases was to create templates in CSS for printing images from a cell phone.
I'd like to request
My web platform jumps through hoops to
If a browser were to suddenly respect EXIF data, this would break how things are currently rendered (double rotation). I can remove my workaround code eventually, but not until all browsers respect EXIF data. I'd need
Regarding angle variants: Services that strip EXIF data from the JPEG might still store that metadata in their database, which would make the angle variant useful for their own rendering. (Though I could also see them leaving just the Orientation EXIF data.) I could also see a human user enjoying the option to manually rotate a deep-embedded EXIF-stripped JPEG via CSS, even if they have to figure out the rotation manually.
Given that mobile apps are static and that the underlying web renderer can change, it is necessary for us app developers to have an option to ensure that our app will work continue working regardless of what mobile app version the user is using and regardless of what webview version the user has installed. If the default behavior of image rendering is going to change, then we need to account for this asap. Do we need to add an
Then yes, start applying
Yes, we're keeping it in precisely so people can use the