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
The code snippet crashes the browser, image over 2 MB, hangs for more than 26s and "save" the image, more or less at the same time, I'm using the ChangeNotifier.
code:
Crop(
aspectRatio: 3 / 4,
// When starting to load the image,
// the code hangs on this line
image: controller.newImg!,
controller: controller.cropController,
// when saving, the code crashes on this line
onCropped: (Uint8List img) {
controller.saveImg(img);
},
),
open to get the image:
Future<void> openGetImg() async {
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.image,
);
if (result == null) return;
extensionImg = result.files.first.extension;
// load the image for Crop
newImg = result.files.single.bytes;
notifyListeners();
}
@andre-ab Thank you for using and giving me feedback. I'm struggling with separating the thread to operate cropping, which is quite slow on web. Let me take some time to improve the performance on web, or if you have an idea, consider to override the cropping logic via imageCropper argument.
The code snippet crashes the browser, image over 2 MB, hangs for more than 26s and "save" the image, more or less at the same time, I'm using the ChangeNotifier.
code:
open to get the image:
Save button
The text was updated successfully, but these errors were encountered: