Open mmuttaqin opened 3 years ago
Second this... awesome package but web takes forever to load / crop image
Thank you for your feedback. I'll check this. Unfortunately crop_your_image is not well tested at Web Platform as I'm not familiar with Web.
For now, can you check the issue below is related? https://github.com/chooyan-eng/crop_your_image/issues/33#issuecomment-830710454
@chooyan-eng Thanks for the reply.
After looking at other cropping tools in flutter it seems that most of them do the image processing on separate process or isolate.
Flutter web doesn't allow to run an isolate and running an html worker could be the trick but I think that would be quite difficult to implement.
So until Flutter decide to implement isolates for web it might be a difficult issue to fix.
Hi! I believe using the dart:ui package and CustomPainter for image manipulation can be a solution for flutter web. I found considerable performance with the following changes.
In decode, but without orientation. In crop
Try using release mode on Flutter web (build with --release
. It's quite a bit faster. For me, 5+ seconds down to ~2 seconds. Still long but not unbearable (assuming the image is under 1MB). It's still too long for large images.
I believe something like https://github.com/deakjahn/flutter_isolate_web would be a good solution. I will take a look at it as soon as I have time
I built a standalone package for cropping on web using the GPU acceleration of the HTML Canvas. A similar approach could be integrated into this package.
I built a standalone package for cropping on web using the GPU acceleration of the HTML Canvas. A similar approach could be integrated into this package.
That does seem like a better approach. I actually like the idea of having the UI and logic in separate packages. Gives a better separation of concerns
Any chance this will be addressed soon?
I have issue too long when cropping image at Web Platform - At android running well. Need improvement at cropping process at web platform
Thanks