
CSS Image Orientation Lands in Firefox 26 - swift
http://sethfowler.org/blog/2013/09/13/new-in-firefox-26-css-image-orientation/
======
0x0
I never understood why the EXIF rotation tag was invented. It's caused so much
pain and wrongly rotated images. Why can't whatever software writing those
tags just rotate the JPEG blocks instead? "jpegtran" can losslessly rotate and
flip JPEG images fine.

~~~
valisystem
EXIF rotation tags exists because it was way more simple for camera
manufacturer than actually move the pixels around depending on orientation
sensor on camera.

That said, what I don't understand myself is software devs that thinks it's ok
to rotate the pixels and saving the image with EXIF tags without updating the
rotation one.

~~~
benjamincburns
> what I don't understand myself is software devs that thinks it's ok to ...

Most people, including software developers, think of JPEG as just a bunch of
pixels.

I think if you were to do a random survey of software developers, most
wouldn't know that the rotation field exists, and an appalling percentage
wouldn't even know that EXIF exists.

Now that I think about it, I wonder what percentage would know that JPEG is a
compressed format, let alone the fact that it's lossy...

------
byuu
What's the technical reason that Firefox (and presumably other browsers) can't
just read the JPEG EXIF data to obtain the proper orientation?

This CSS tag could still be marginally useful: you could store only one corner
and one side of a custom border, and flip the image for the other three. Once
the tag is ubiquitous, of course.

~~~
paulrouget
> What's the technical reason that Firefox (and presumably other browsers)
> can't just read the JPEG EXIF data to obtain the proper orientation?

It's what `image-orientation: from-image` does.

But it can't be done automatically (you have to explicitly use this property),
that would break the web: until now, images were not rotated automatically, so
developers might have rotated their images in CSS (`transform:rotate(90deg)`).
If Firefox were to rotate automatically the images according to the exif data,
you'd get a double rotation, or unexpected image rotations.

~~~
foxhill
but what happens when you view a direct link to an image? imo, the rotation
data like that should be associated with the file, and respected all the time.
it might break a few things, but i'm fairly certain people could figure out
the fix required :)

~~~
derefr
The point is that if you fix it in new browsers, you'll break it in old
browsers, and vice-versa. Adding an "opt-in" for the new (correct) way of
doing things lets you serve the old client-side rotation logic to the old
browsers, and the CSS pragma to the new browsers.

------
AndreasFrom
Uhmm, all the images are oriented right in Safari on my iPad.

~~~
jasonlotito
But not Safari on the desktop.

So, what's your issue?

~~~
foxhill
from what i can see, both chrome and safari respect the rotation data.

~~~
swift
Only on the iPad, where they're both using Apple's iPad version of WebKit.

This isn't standards-compliant behavior. I had no idea that there were any
browsers that actually did this!

~~~
lttlrck
And iPhone.

------
ape4
Will this be misused. Will sites have tons of rotating images. The new blink?

~~~
radq
Rotating images were already possible before with transform:rotate().

