jasny / bootstrap

The missing components for your favorite front-end framework.
https://www.jasny.net/bootstrap/
Apache License 2.0
2.68k stars 496 forks source link

Image orientation using exif not working #609

Closed rudresh-csp closed 4 years ago

rudresh-csp commented 4 years ago

Type: Support/Bug

There is an issue with a project where I'm using the latest version of this. Few images especially clicked from using phones in portrait orientation get rotated.

I went to the issue and found the following condition in fileinput.js

preview.html($img)
if (Fileinput.options.exif) {
    //Fix image tranformation if this is possible
    Fileinput.setImageTransform($img, file);
 }

In the console(if i do console.log(Fileinput.options)), I'm getting this for every image. image

I have a few doubts,

  1. If I comment the if condition, it works fine. Just wanted to know the significance of this check, do we really need it?
  2. Does it transform(rotates) the original file input as well? When I store the image and then came back to edit, it shows the original(untransformed one).

Thanks

jasny commented 4 years ago

Yes, use the exif option. I've added it to the documentation.