You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the whole library is not using web worker when starting to crop using controller.crop() the cropping blocks the main thread resulting in a frozen page. A side effect of this is that the progressIndicator did also not work on web.
@c-seeger Thank you for the suggestion. As I'm not very familiar with web, let me take some time to challenge solving this. If you are in a hurry, consider overriding cropping logic with imageCropper parameter.
classYourCustomImageCropper<Image> extendsImageCropper {
@overrideFutureOr<Uint8List> call({
requiredImage original,
requiredOffset topLeft,
requiredOffset bottomRight,
ImageFormat outputFormat =ImageFormat.jpeg,
ImageShape shape =ImageShape.rectangle,
}) {
// call `defaultImageCropper.call()` using some trick not to block during operation.// return the result of the step above.
}
}
@c-seegerObrigado pela sugestão. Como não estou muito familiarizado com a web, deixe-me dedicar algum tempo para desafiar a solução disso. Se você estiver com pressa, considere substituir a lógica de corte pelo imageCropperparâmetro.
classYourCustomImageCropper<Image> extendsImageCropper {
@overrideFutureOr<Uint8List> call({
requiredImage original,
requiredOffset topLeft,
requiredOffset bottomRight,
ImageFormat outputFormat =ImageFormat.jpeg,
ImageShape shape =ImageShape.rectangle,
}) {
// call `defaultImageCropper.call()` using some trick not to block during operation.// return the result of the step above.
}
}
Since the whole library is not using web worker when starting to crop using
controller.crop()
the cropping blocks the main thread resulting in a frozen page. A side effect of this is that the progressIndicator did also not work on web.maybe sth. like https://pub.dev/packages/squadron could help solving the multithreading problems for web
The text was updated successfully, but these errors were encountered: