ngImgCrop
ngImgCrop copied to clipboard
Example form upload code not working on iOS device's taken camera image.
On iOS (tested on Chrome iOS and Safari iOS), if I press the "Choose File" button on input form and select take picture, after the picture has been taken the code assign it to variable $scope.myImage as shown in the example. However, on iOS it does not update ngImgCrop with the photo taken. (Choosing from photo library is working fine)
Note that on Android you can take the picture and it will instantly appear on ngImgCrop.
Try with horizontal images. In my case, these work. Let's see if we can find a solution to this...
Wow you're right! It does work with horizontal images.. I wonder is this a kind of EXIF problem?
I have no clue. I've try with both horizontal and 1:1 (square) images and both work. In mobile devices this is a big issue.
Anyone else has found anything?
I'm also facing same issue and it's difficult to debug as it's not reproducible when we are testing it in chrome iOS...May be we need sophisticated mobile emulator...plz let me know if anybody found any solution...
I would like to add that, only backfacing camera with landscape orientation worked. On front camera of my iPod touch, neither orientation worked at all.
I believe the issue is to do with the way the images are manipulated when EXIF data exists. There is a call to .toDataURL("image/png") from the HTML5 canvas that doesn't work if the image taken by the camera is too big. I have just fixed the issue within iblank's fork of this project, which also has a bunch of lovely stuff in it, including fixed aspect ratios.
The pull request is here. https://github.com/iblank/ngImgCrop/pull/1
I have created a GIST (untested) for those of you using the unforked version of the lib.
https://gist.github.com/hbbh/d5f21c4120665f9429e3
this is a replacement for the setNewImageSource function, which is originally found in crop-host.js file and should just replace the same function in the compilled version. I haven't created a pull request as I've not had time to test in the original repo.
I had the same issue (working with horiz picture but not vertical) and hbbh's fixe work great! I replace the setNewImageSource function with his and now it works like a charm on iOS 8 (iPad) Thank you!!
I had the same issue and fix it with hbbh's solution. Thank you very much!
thx, hbbh!
@hbbh do you think your fix will get into an official release eventually?
hbbh's answer gets it working for me, however vertical pictures are rotated sideways