crop_your_image icon indicating copy to clipboard operation
crop_your_image copied to clipboard

First load is slowly & Loading widget should customizable

Open rikai-trongpq opened this issue 3 years ago • 7 comments

I don't know what this function that to do but it need too much time to done.

@override
  void didChangeDependencies() {
    final future = compute(_fromByteData, widget.image);
    _lastComputed = future;
    future.then((converted) {
      if (_lastComputed == future) {
        _targetImage = converted;
        _withCircleUi = widget.withCircleUi;
        _resetCroppingArea();

        setState(() {
          _lastComputed = null;
        });
        widget.onStatusChanged?.call(CropStatus.ready);
      }
    });
    super.didChangeDependencies();
  }

And I suggest for you that CircleProgressLoading should be customizable.

rikai-trongpq avatar Jan 17 '22 07:01 rikai-trongpq

Any update?

rikai-trongpq avatar Jan 20 '22 08:01 rikai-trongpq

@rikai-trongpq Hi, thank you for your feedback.

That function is to read given image data of Uint8List and convert to Image object which has width and height of raw image.

I have very few time to maintain this package and no update yet, so I'm appreciate if you send some pull request showing how to solve this issue.

chooyan-eng avatar Mar 08 '22 09:03 chooyan-eng

Same problem. Loading the image cost too much time about 2 seconds, this is intolerable in my app. Why ?

2e2ee95304418f96 avatar Jun 27 '22 16:06 2e2ee95304418f96

@rikai-trongpq

And I suggest for you that CircleProgressLoading should be customizable.

I solved this point with version 0.7.3. You can check the change in PR https://github.com/chooyan-eng/crop_your_image/pull/75 .

Thanks.

chooyan-eng avatar Nov 15 '22 08:11 chooyan-eng

Actually, loading time depends mainly on the computation in crop package, which calculates the actual size of the images starting with detecting the format of it. It's not the same story with just displaying images with Image.memory().

I'm thinking of receiving imageFormat parameter to Crop so that image package can skip detecting iamges' format.

chooyan-eng avatar Nov 15 '22 08:11 chooyan-eng

Replace Image.memory with Image.file will be faster.

luwies avatar Jan 15 '23 15:01 luwies

I couldn't find a way to make it faster and I updated and published the old simple_image_crop with null-safety as simple_image_crop_plus

It's fast, and successful with circle UI.

MCYBA avatar May 10 '24 13:05 MCYBA