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 are not cropped .save() #6

Open
SergejSi opened this issue Dec 28, 2020 · 1 comment
Open

Images are not cropped .save() #6

SergejSi opened this issue Dec 28, 2020 · 1 comment

Comments

@SergejSi
Copy link

SergejSi commented Dec 28, 2020

Images seems not to be cropped on call the save() method, like shown in the following example

createFormData() {
   const result = await this.$refs.cropgram.save()

   const data = new FormData();
   //list of your pics
   result.forEach((picture, index) => {
         data.append(`media[${index}]`, picture.url || picture.blob);
   });
   return data;
},



`

I'm also get the following error, after toggling the badge (num) on the thumbnails:

Vue warn]: Error in v-on handler (Promise/async): "TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'"

@SergejSi
Copy link
Author

Problem seems to be solved by adding
this.$refs.cropgram.updateCurrentSortedItem();

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