Closed enoh-barbu closed 3 years ago
Hello, @enoh-barbu!
Welcome to the open source. This documentation is written by me. I don't receive any financial support and do it on my own, so I don't have enough time to make it perfect. Moreover, it's the beta version and this library is still in the development as well as its documentation.
So instead of unconstructive criticism, I suggest you to write an specific comments, what should be improved. It would be very helpful for our community.
I got crazy last night trying to make it working, spent about 3 hours on that, still no results. I understand your statements and agree with them, but in my opinion, this should not go live if the job is half done. I won't put more details. Just wanted to release my stress out here.
@enoh-barbu there are two kinds of people in the world: who knows how to do things right and who do things. In any case, it's impossible to make the documentation that will be clear for all users without its beta testing. To facilitate their lives I don't mind if users asks their questions in the issues section in this situation, I try to reply them quickly enough.
I won't put more details.
Why? Just describe your problem in a nutshell. I will be glad to help you.
PreviewResult is nowhere documented. In code examples seems to accept an image which should be an object?? with what properties? How the image can be passed to that? This is just an example, but again, I won't put more work on your belt as I understand you're doing it in your spare time.
@enoh-barbu, first of all, PreviewResult
is the service component used to display the image in the stencil component. The img
is object, indeed, and it's passed to this component by cropper itself.
Did you want to create the custom stencil? I have feeling that you wanted just output the preview of cropped image just like there:
This is just an example, but again, I won't put more work on your belt as I understand you're doing it in your spare time.
Now I know, that I have problem and it's disturbing me, so I'm ready to spend additional time to solve it.
I suppose that this fragment of the documentation misled you:
It's pretty rare situation when it will be needed you (only for custom stencil),
I just tried to copy paste the last code example from here I've created a component for that. I need to pass my image. I get this Invalid prop: type check failed for prop "img". Expected Object, got String with value "blob
Oh, so PreviewResult is that image on the right side, you've showed above....great! I just now barely understood what it does!
Oh, so PreviewResult is that image on the right side, you've showed above....great! I just now barely understood what it does!
No, no. PreviewResult
is the service component, that is used in the stencil internally to display the cropped area.
I've created a component for that. I need to pass my image. I get this Invalid prop: type check failed for prop "img". Expected Object, got String with value "blob
You cannot pass your image to this stencil directly, it's the stencil, not cropper. I suppose you should need take a look at the full example.
The stencil code is in Stencil.vue
, the cropper code is in App.vue
.
Anyway, what did you want to get exactly? The cropper with this specific circle?
I thought the code above is to have this result
at the full example. now this makes sense
I thought the code above is to have this result
Now I understand that it's not obvious. I will try to make it more clear to users and provide the link to that codesandbox (I suppose, that similar codesandboxes will be useful for other examples too).
Thanks.
that will make it easier! thanks! sorry for the hard words
All's well that ends well. I hope that my library helped you to solve your task.
at the full example. now this makes sense
I believe this example now include a bug where if you try first to resize the stencil (not drag it), stencil is stuck and cannot move afterwards.
@yogsky, thank you! It's fixed now.
@Norserium 🥇 First off, thanks a lot (also for the awesome package). May I ask what was the needed change that you made 🤓 ?
@yogsky, my pleasure.
In the previous versions ResizeEvent
received three arguments, include the native event. I decide, that the first argument (i.e. event) is redundant, because I can't rely on event, that user passes, so it was removed in the new versions.
To fix this problem I just removed the passing of the native event as the first argument of ResizeEvent
constructor (line 50).
@Norserium, got it, Thank you! ❤️
Would be nice to add a search bar to the documantaion!