-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package has stopped working on web after upgrade to flutter 3.0 version #10
Comments
Who would've thought? :-) Actually, this is just a convenience function on the controller and calls some Flutter functions that used to create problems in the past, too: crop_image/lib/src/crop_controller.dart Lines 122 to 135 in 0a8cb04
So, I think we have to wait a little to see what other bug reports complain about this again. |
@zombie6888 Could you help me with this? I created a small repro to show the problem but, since I have moved on to 3.0 now, I can't test it on the earlier Flutter any more. It's a simple page that should show the image somewhat cropped in the middle. If you uncomment the first line in |
Done, your example works in 2.10.5. What i did:
|
Thanks a lot, I'll report it right away. |
@zombie6888 flutter/flutter#103803 Let's hope for the best... |
@zombie6888 Fortunately, it was accepted as a reproducible regression, so I expect a quick fix. |
Perfect! Btw, i have a question that is not related to issue, i can create separate thread but ask here if you don't mind. Is it possible to convert Picture to Uint8List instead of Picture.toImage() somehow? I use ImagePicker and another package which is convert bytes(from png source for example) to jpeg. So i think i use a lot of redundant conversions on the web: First i convert picked image to bytes by using XFile.readAsBytes() method, then i place it to Image.memory() and cropped by Picture.toImage(), then, in order to get byteArray again i use Image.toByteData method, decode obtained byteArray and convert to jpeg by using this package https://pub.dev/packages/image and finally pass jpeg encoded bytes to backend services. It works well, but i am not sure that it's a proper way to do such things. it also would be better if toByteData method has ImageByteFormat jpeg support but it works with png only. |
If you also want to crop, you have to use the Canvas and that comes with Picture.toImage(), anyway. If your only problem is that you want to use jpeg, this is what I do in a program of mine:
As you can see, instead of using that Actually, I also have a |
This is exactly what i need. Thank you! |
It's a CanvasKit problem. This solves the problem for now: flutter run -d chrome --web-renderer canvaskit --dart-define=BROWSER_IMAGE_DECODING_ENABLED=false --profile |
@zombie6888 Come to think of it, I made it into a very simple package: https://pub.dev/packages/jpeg_encode |
Here is a package that does the image cropping separately (including web), and uses crop values generated by the crop_image UX. https://pub.dev/packages/cream_of_the_crop |
Thank you for nice package! It's very simple to use. I've tried to upgrade to a new flutter 3.0 version and faced with problem on web. It doesn't cause any errors but render blank image when cropped. After downgrade to flutter version 2.10 it works as before
The text was updated successfully, but these errors were encountered: