image-orientation
Quick Summary for image-orientation
The image-orientation CSS property specifies a layout-independent correction to the orientation of an image.
Code Usage for image-orientation

<pre class="brush: css notranslate"><code><span class="token comment">/ keyword values /</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> from-image<span class="token punctuation">;</span> <span class="token comment">/ Use EXIF data from the image /</span> <span class="token comment">/ Global values /</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> inherit<span class="token punctuation">;</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> initial<span class="token punctuation">;</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> revert<span class="token punctuation">;</span> <span class="token property">image-orientation</span><span class="token punctuation">:</span> unset<span class="token punctuation">;</span> </code></pre>

More Details for image-orientation

image-orientation

The image-orientation CSS property specifies a layout-independent correction to the orientation of an image.

/* keyword values */ image-orientation: none; image-orientation: from-image; /* Use EXIF data from the image */  /* Global values */ image-orientation: inherit; image-orientation: initial; image-orientation: revert; image-orientation: unset; 

Syntax

Values

none

Does not apply any additional image rotation; the image is oriented as encoded or as other CSS property values dictate.

from-image

Default initial value. The EXIF information contained in the image is used to rotate the image appropriately.

Description

This property is intended only to be used for the purpose of correcting the orientation of images which were shot with the camera rotated. It should not be used for arbitrary rotations. For any purpose other than correcting an image's orientation due to how it was shot or scanned, use a transform property with the rotate keyword to specify rotation. This includes any user-directed changes to the orientation of the image, or changes required for printing in portrait versus landscape orientation.

If used in conjunction with other CSS properties, such as a <transform-function>, any image-orientation rotation is applied before any other transformations.

Formal definition

Initial valuefrom-image
Applies toall elements
Inheritedyes
Computed valuean <angle>, rounded to the next quarter turn from 0deg and normalized, that is moduloing the value by 1turn
Animation typediscrete

Formal syntax

from-image | <angle> | [ <angle>? flip ]

Examples

Orienting image from image data

The following image has been rotated through 180 degrees, and the image-orientation property is used to correct its orientation based on the EXIF data in the image. By changing the image-orientation to none you can see the effect of the property.

CSS
#image {   image-orientation: from-image; /* Can be changed in the live sample */ } 
Result

Specifications

Specification
CSS Images Module Level 3 # the-image-orientation

See also

Other image-related CSS properties: object-fit, object-position, image-orientation, image-rendering, image-resolution. transform and rotate

Last modified: Feb 4, 2022, by MDN contributors

Select your preferred language English (US)DeutschFrançais日本語中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


seren spirit :(
Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.