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

get image blob without cropping #39

Closed
mshqlaih opened this issue Apr 22, 2021 · 4 comments
Closed

get image blob without cropping #39

mshqlaih opened this issue Apr 22, 2021 · 4 comments

Comments

@mshqlaih
Copy link

hi
know I can get image as blob after make any crop to the image , but I want to take image as blob without cropping it.

Thanks
Maher

@fengyuanchen
Copy link
Owner

You don't need to make a crop, just call the getCroppedCanvas method directly:

cropper.clear().getCroppedCanvas().toBlob(function (blob) {
  console.log(blob);
});

@mshqlaih
Copy link
Author

mshqlaih commented Apr 24, 2021

please more detail (or an exmple) , I put the photo-editor in iframe. how can I get the cropper as variable to do up answer?
Thanks
Maher

@fengyuanchen
Copy link
Owner

Just read the documentation of the Cropper.js: https://github.com/fengyuanchen/cropperjs

@mshqlaih
Copy link
Author

hi
after i upload my image the src of image is like this :
blob:http://academicprogs.iugaza.edu/e6475d62-18dc-419d-adec-7719c10de1d3
then when i use your code above i faced this problem:
Uncaught TypeError: Cannot read property 'toBlob' of null

any help please.

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

2 participants