alexk111 / ngImgCrop

Image Crop directive for AngularJS (THIS PROJECT IS NOT MAINTAINED ANYMORE)
MIT License
1.12k stars 516 forks source link

Was working on samsung phones. Not anymore. #121

Open outlawbruce opened 8 years ago

outlawbruce commented 8 years ago

When taking an image (selfie) from a samsung phone the result emage stays blank. It works fine when selecting image from phones gallery. This wasn't an issue a few weeks ago. What could have went wrong. Tested on samsung ace 2 and 3. s6 edege and edge plus. If it was any other phone make you could probably get away with it but samsung is a must, half the planet has them.

paranoia5 commented 8 years ago

I have got the same problem with S4, but on S3 still works just fine. I'm guessing the problem occurred on my S4 due to the browser update I have made few days ago on the device. Anybody is experiencing the same problem? Plz share!

paranoia5 commented 8 years ago

After a few hours investigation I found out that the problem happens bcuz of "Android System Webview" new updates (u can find that under 'application manager' in your device Settings). Once I uninstalled the updates, everything works great. Now we need to investigate the conflicts b/w imgCrop script and the new updates of "android system webview"

outlawbruce commented 8 years ago

You are 100% correct. It works when you uninstall chrome updates. I'm in process of investigating. Let me know how you are getting on also :+1:

paranoia5 commented 8 years ago

I've figured 2 ways to solve that problem. 1) if you are using content-security-policy meta tag, then you probably need to add the right values to img-src directive. in my case the image is base64 so I added (img-src 'self' data:) so the browser can allow loading them. see more details here http://content-security-policy.com/ (worked for me)

2) if your problem was not solved using the first solution, I recommend installing crosswalk plugin which would not only solve the problem, but will increase the rendering performance on android devices. Though, the only downside of it is that you will have two separate builds (arm and x86) and you will see about 15mb increase in the size of the apk.

hope that helps!

outlawbruce commented 8 years ago

oddly enough it started working on chrome mobile again even without using the content-security-policy meta tag. Must have been another chrome update that fixed it. But i guess we better keep the content-security on there for fear it happens again.

I like your option 2. I have been using crosswalk it solves all android browser compatibility issues on the image upload. The one thing that catches me with it is the file picker. Instead of camera and gallery it gives 4 option: Camera, Documents, Camcorder and Voice recorder. 46481651