Warning: Some modern browsers automatically rotate images based on their exif. They're changing default value of the css property image-orientation
from 'none'
to 'from-image'
on <img>
elements and background-image
. However they can also pass rotated photo to <canvas>
through ctx.drawImage()
. Though this behavior is quirky and differs from browser to browser, especially in Safari on iOs 13.4 and newer.
Use exifr.rotation()
if you want to manipulate the image and avoid afore mentioned problems.
If canvas
property is true
, you need to rotate the image yourself in <canvas>
using ctx.rotate(...)
.
If css
property is true
, you need to rotate the image yourself with CSS using transform:rotate(...)
.