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

Does not work with CSP img-src where data: sources are blocked #65

Open
codemasterover9000 opened this issue Dec 15, 2017 · 0 comments
Open

Comments

@codemasterover9000
Copy link

The problem occurs when selecting images with non default orientation (from camera for example). Cropper tries to rotate the image for viewing. Rendering the image to a rotated canvas and making an image from the canvas using a data: url.

To reproduce
To reproduce open the following image https://github.com/recurser/exif-orientation-examples/blob/master/Portrait_7.jpg in one of the demos with CSP header as img-src 'self' blob:;

You can use this plugin for quick testing from the browser: https://chrome.google.com/webstore/detail/csp-tester/ehmipebdmhlmikaopdfoinmcjhhfadlf

Possible solutions
Instead of producing an intermediate image, rendering the source (blob:) image directly rotated onto the target canvas would probably fix the problem.

Or

Add an option to disable auto orientation correction and add rotation controls to the component.

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

1 participant