-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Issue with photo aspect ratio when replacing cropper image with a photo from camera on iPhone 6 #509
Comments
Hi, I am also facing the same issue and this issue is already mentioned in documentations of plugin. But I didn't get any solution till now. If anyone found solution, please post here |
Maybe this is a problem caused by the image's Exif Orientation. You may try the Loader to translate Exif Orientation by canvas and get a pure image for Cropper. |
的确,在移动端照片剪裁初始化的时候会有这个图片变形的问题。iphone4S手机裁剪照片初始化横图显示正常,竖图会被压扁。电脑端似乎没有这个问题。 |
As of v2.2.0, the Exif Orientation will be overridden if the browser supports ArrayBuffer. |
I use fileReader to get a image of base64 with cropper(v2.2.1)。 #509 is still there |
@qiankaijie What's version of your browser? |
@fengyuanchen the latest wechat browser. It is ok in chrome |
WeChat browser...It might not support ArrayBuffer... |
If a browser supports Typed Array, then this issue may be fixed since Cropper v2.2.0. Browser support of Typed Array:
|
I'm seeing this issue as well. I learned that the iPhone is storing portrait photos taken with the camera in landscape and saving the rotation in Exif Orientation. It seems like Safari on the iPhone is giving the wrong naturalHeight and naturalWidth. For the same image transferred to my Mac, I do not see the problem. I commented out these lines: https://github.com/fengyuanchen/cropper/blob/master/src/js/utilities.js#L53-L55 And now it works properly on my iPhone (9.2, 5s) and my laptop (10.11.2) I hope this helps. |
@fengyuanchen thank you for the great plugin! I too am having this issue, and I was also able to fix it by commenting out those three lines that @mjvestal pointed out. |
Hi, really appriciate your efforts on this great plugin! It do helps. And I figured out that you have recently updated to fix the bugs on safari. Thank you.
and here: `function getImageSize(image, callback) {
}` and here `if (ifdStart) {
If you have any questions or better ideas, pls tell me. |
@JoJoChilly There are too many browsers in the world, includes lots of built-in browsers as WeChat's, I think it is not necessary to support all of them as it will waste a lot of time on this. |
@fengyuanchen ,作为中国的开发者,按照现在移动互联网生态状况,不支持微信就说不过去了吧。 |
@JoJoChilly Thanks, it works for me. |
When I take a photo/replace a photo shot in portrait mode (414 x 736 points or 1242 x 2208 pixels) on my iPhone 6 plus and upload the photo into the cropper the photo in portrait mode is distorted and cropped off in the image container even before I get a chance to crop it.
This seems to occur both in the demo and in my own use of cropper. I attached a few sample images - you can see how the result in the cropper is not the same aspect ratio of the original photo I took.
Do you know if this is a bug? If so can you please issue a fix?
Thanks kindly in advance.
The text was updated successfully, but these errors were encountered: