Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images on iOS #37

Closed
brianchance opened this issue Dec 23, 2015 · 2 comments
Closed

Images on iOS #37

brianchance opened this issue Dec 23, 2015 · 2 comments

Comments

@brianchance
Copy link

I have croppie working on mobile iOS 9.2, but I am having some challenges getting what I want...

My viewport is 260x260, square and the boundary is 300x300. When I load an image from on my phone that is, say 960x1260 (the default), it does not scale down and with the zoom all the way left, it is still to close up to make any details out.

You can see the same results on the demo page's upload example.

Digging in with Safari's web inspector, it looks like iOS is giving a "Cross-Origin Resource Sharing policy error" in loadImage so img.onload never fires to resolve the promise and _updatePropertiesFromImage never gets called. If I manually call _updatePropertiesFromImage, the image looks correct.

Checking around the internet, I am thinking that
img.setAttribute('crossOrigin', 'anonymous');
should be...

if(src.substring(0,4).toLowerCase()==='http') {
    img.setAttribute('crossOrigin', 'anonymous');
}
@brianchance brianchance changed the title Images on iOS and Android Images on iOS Dec 23, 2015
@r6047736
Copy link

r6047736 commented Jan 3, 2016

Thank You, had same problem and your solution fixed it 👍

@thedustinsmith
Copy link
Contributor

Perfect! We'll make this change sometime this week. Been out for the holidays for the past couple weeks, sorry it took so long to respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants