0

I am working on a project where i need to upload photo to canvas but the problem is arising that when user uploading image from iphone, image is automatically getting rotated 90deg.

Is there any way i can check image's orientation using Javascript? and if i can rotate image if its orientation is not Normal(Horizontal)?

Thanks in Advance.

Stefan
  • 5,203
  • 8
  • 27
  • 51
Bhaskar Dabhi
  • 841
  • 1
  • 11
  • 28

1 Answers1

0

The device that takes the picture that it actually has a sensor that can tell orientation.

Using window.orientation we can get orientation either portrait or landscape

Refer

How do I correctly detect orientation change using javascript and Phonegap in IOS?

How to extract image orientation information from image loaded in Canvas

Community
  • 1
  • 1
Sridhar R
  • 20,190
  • 6
  • 38
  • 35