You will need to convert the image to correct the orientation. Fortunately, the image should include EXIF ββdata that you can use to do this. If you like, you can do this before the image is uploaded to your server:
- Read EXIF ββimage
- Use the canvas element to transform the image depending on the situation.
- Export canvas image to image file
There is an excellent entry, including code samples, in this blog post.
source share