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.

4

1 回答 1

0

拍摄照片的设备实际上有一个可以分辨方向的传感器。

使用window.orientation我们可以获得纵向或横向的方向

参考

如何在 IOS 中使用 javascript 和 Phonegap 正确检测方向变化?

如何从 Canvas 中加载的图像中提取图像方向信息

于 2013-11-05T04:55:15.657 回答