Is there a way to tell browsers to honor the jpeg exif orientation?

CSS image-orientation: from-image

from the specs

6.2. Orienting an Image on the Page: the ‘image-orientation’ property

image-orientation: from-image

from-image: If the image has an orientation specified in its metadata, such as EXIF, this value computes to the angle that the metadata specifies is necessary to correctly orient the image. If necessary, this angle is then rounded and normalized as described above for an value. If there is no orientation specified in its metadata, this value computes to ‘0deg’.

Matching Chrome-Issue:

But the browser support is not here yet:

Rotate via JS

There is a JS snippet to do this:

My conclusion

I think rotating the image on the server with tools like imagemagick is too much overhead.

The browser can rotate the image, but the web application needs to give the advice how to rotate this explicitly.

This explicit in browser rotation could be done like this:

Leave a Comment