-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Image cropper fallback image #5936
Comments
Maybe an additional event (ImageFailed) can be put if you don't want to change the current api |
Thanks for mentioning this. It was actually implemented #5916 (comment) I will finish it for the next release. |
only thing missing is then the fallback/unset source image |
I don't think placing fallback images should be something that Blazorise is responsible for. Such an image is highly opinionated: dark theme or light? With text or without? What about the language? Additionally, it would add resources to the library, which would increase its size—not by much, but for such a low-use case, I don't think it's worth it. The cropper is designed to be used with a valid source. If the source isn't valid, the component won't throw an error but will gracefully notify the developer. The issue of an invalid source doesn't originate from the cropper component itself, which is why I think the cropper shouldn't be responsible for handling user interactions in this state. There are plenty of ways to handle such scenarios—hiding the cropper, placing a fallback image, or showing an error message to the user. Developer should decide and implement the proper "flow"... wdyt, @stsrki? |
I agree with @tesar-tech, it's better to leave the fallback image to the developer. We will just provide an API that is used to determine the error. |
one of this issues with this is that the cropper component is very javascript heavy so you see if flicker, because of the round-trip between js and blazor. But I understand that you like to keep it this way. I will put an enhancement request in the cropper.js library to see if there is a way to replace the gray background with some other image |
I would like a way to set a fallback image for when loading of the image fails or no source has been set yet so you won't see the empty gray canvas, but you can show a placeholder image.
There is an ImageReady event, but it doesn't indicate if loading actually succeeded. Maybe this event can return a bool value?
The text was updated successfully, but these errors were encountered: