-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exif orientation/rotation is being ignored #181
Comments
What do you mean by not shown properly? All this library does is pass the image source into an image |
Try loading one of the rotated images of the given link into the cropper, e.g. Landscape_6.jpg, and you will see what I mean by saying "not shown properly". |
I can confirm that, for example image captured from iphone: https://imgur.com/a/7o6TRBo There is a screenshot, at up left corner You can see image uploaded from iphone (made in vertical phone orientation), at bottom is canvas with crop |
@dominictobias Try to get result in canvas as u showed in example. Image in canvas is displayed in another orientation than in |
@bartoszboruta so which one is correct? The canvas isn't correct? |
@dominictobias yes, canvas on ios is in different orientation that original |
So it sounds like a bug with the browser. This library doesn't do anything special it just displays the image source in an From a google search and answers like this https://stackoverflow.com/questions/20600800/js-client-side-exif-orientation-rotate-and-mirror-jpeg-images It seems you have to manually rotate the canvas according to the exif orientation: https://github.com/blueimp/JavaScript-Load-Image/blob/master/js/load-image-orientation.js#L54 Here's a blog about using that library if you're stuck: https://nsulistiyawan.github.io/2016/07/11/Fix-image-orientation-with-Javascript.html |
To solve this issue you need to use the JavaScript Load Image image loader instead of file reader. The blog provided was excellent. Make sure |
To solve the issue you need to use the JavaScript-Load-Image library: https://github.com/blueimp/JavaScript-Load-Image and load the input file as follows: |
"TypeError: img.toDataURL is not a function" When i use JavaScript-Load-Image , Do you have any codepen example |
Did you import blueimp-load-image ? |
@prashantpatil14 I was having the same issue. When I added |
@nirfuchs73 Did you end up finding out how to import it? |
@desduvauchelle yes |
I posted a stackoverflow question for the issue, as it could help other people: https://stackoverflow.com/questions/61327357/react-image-crop-image-rotation-issue-only-in-portrait-mode-of-iphone |
I was getting the same error that @prashantpatil14 was reporting with the correct import, and I also observe it on the stackoverflow example @desduvauchelle posted. I had to add I was able to get it to work using this snippet:
|
If the image is rotated or flipped via Exif data, this information is not taken care of. As a result, the image is not shown properly in the cropper.
Example images: https://github.com/recurser/exif-orientation-examples
The text was updated successfully, but these errors were encountered: