chooyan-eng / crop_your_image

A flutter plugin which provides Crop Widget for cropping images.
https://pub.dev/packages/crop_your_image
Apache License 2.0
157 stars 138 forks source link

Instance of 'InvalidRectError' #150

Open ygx-123456 opened 5 months ago

ygx-123456 commented 5 months ago

When I triggered the cropController.crop() method, an error occurred: Instance of 'InvalidRectError' image_image_cropper.dart in ImageImageCropper.call at line 35 within crop_your_image crop.dart in _cropFunc at line 765 within crop_your_image _isolates_io.dart in compute. at line 19 within flutter isolate in _RemoteRunner._run at line 1090 isolate in _RemoteRunner._remoteExecute at line 1084 isolate_patch.dart in _delayEntrypointInvocation. at line 300 isolate_patch.dart in _RawReceivePort._handleMessage at line 184

package version crop_your_image: ^1.0.2 iphone 12 Pro
IOS17.1.2 flutter 3.19.5 dart 3.2.3 image data: b74ed962e6aa74e51c2f3dc619fcfbf8

yeikel16 commented 5 months ago

Hi @ygx-123456, I have the same error in console, you can use the initialRectBuilder method in the Crop widget. This worked for me.

initialRectBuilder: (viewportRect, imageRect) => imageRect,
disilva21 commented 5 months ago

Tenho o mesmo problema, fiz o que @yeikel16 recomendou mas não funcionou. Pelo que vi, sempre que da o zoom na imagem para fazer o crop até os limites da imagem da esse problema.

Exemplo que dá o erro: image

Exemplo que funciona: image

Se alguém puder ajudar, agradeço!